So you're getting an error message like the following, although your Gemfile lists shoulda-matchers and it has always worked: NoMethodError: undefined method `allow_value' for #
...to Rails 4.1 (specifically, Spring) revealing a weak point of shoulda-matchers -- jonleighton explains why. Solution The solution is to follow the gem's installation guide: # Gemfile gem 'shoulda-matchers...
Note that you can also go "up", to the controller, using a similiar icon in the first line of a view...
To open a terminal quickly navigate to System → Preferences → Keyboard Shortcuts. There, click the "Run a terminal" row (It should be in the "Desktop" section) and press the keyboard shortcut...
...for Ubuntu's default terminal is gnome-terminal. Be aware that many programs use shortcuts of their own and you would not want to clash with those (like Ctrl+T...
You can make both mobile Chrome and mobile Safari display a native app install banner. The banner suggests that the user installs an app that is related to the current...
...page. It is shown in the phone's native UI. See attached animation. There is some fineprint you need to read to make this work (see below). References Android: Increasing...
Do not use .rvmrc files to specify Ruby version and gemset configuration any longer, it's deprecated and not considered by other Ruby version managers such as rbenv.
...migrate an existing .rvmrc you can use rvm rvmrc to .ruby-version. Put gemset specification into .ruby-gemset. Creating the .ruby-version file on your own, just make a file...
...an OpenStack instance: # nova resize example 23 --poll ERROR: Resize requires a change in size. (HTTP 400) You need to change your flavor to have a different memory size. It...
...convinced that an error must be very close to the network card, OS IP stack or compiler. In reality this is quite rare, so before continuing, triple-check that the...
...issue is not located between chair and keyboard... If you're still convinced that a in-depth analysis of network traffic might help you, go on: Find out the IP...
Do it like this: attribute :active, Virtus::Attribute::Boolean Long story In Virtus you define attribute with their type like this: attribute :name, String attribute :birthday, Date
...only TrueClass and FalseClass), so use Virtus::Attribute::Boolean instead. The reason while Boolean sometimes survives compilation is that many libraries define a global Boolean class for some reason. That...
The usage shares of your site highly depends on your target audience. E.g. no Internet Explorer has ever seen hollyapp.com, but that's because of its tech-savvy audience. Distribution...
...will also differ by other factors, such as region. See this Wikipedia article for details. If you don't know your audience, you can use the stats of tracking tools...
When some of your Google contacts are no longer synchronized with your e-mail client or mobile phone, those contacts are not in a group "My Contacts". Google only syncs...
...contacts in that group. In order to fix this: Open Google Contacts Select all contacts (there's a link) Press "Move to My Contacts" Note that when you are using...
Note: The behaviour of Spreewald's within step is as described below for version < 1.9.0; For Spreewald >= 1.9.0 it is as described in Solution 1. When doing integration testing with...
...cucumber and selenium you will often encounter problems with timing - For example if your test runs faster than your application, html elements may not yet be visible when the test...
Chances are you're seeing the warning repeated a lot of times, maybe thousands of times. Here's how to reproduce the issue: Example 1 # bad code (Time.current .. Time.current + 1.hour...
...include?(Time.current) # Use Range#cover? instead of Range#include? since the former does no typecasting into integers. (Time.current .. Time.current + 1.hour).cover?(Time.current) Example 2 # bad code Post.where(:created_at => min_date.beginning...
...toggle an outlining of HTML elements quickly. This helps greatly when you want to see the actual dimensions of elements, e.g. for floating elements inside containers, instead of opening up...
...shortcut (Shift+G for the 9.2-compatible layout or for the default layout with enabled "single-key shortcuts") and select "Outline" from the View → Style menu (needs to be done...
...Add to ckeditor/config.js CKEDITOR.editorConfig = function(config) { config.contentsCss = [ '/assets/myCkeditorStyles.css', // any other file to encapsulate custom styles '/assets/myFontFaceTags.css' ]; } It's not enough to provide the font face tags within your public folder...
...call it within the ckeditor/config.js. You also might be interested in CKEditor asset pipline support...
Consider the following HTML & CSS: ^ img { background-color: red; } div { border: 1px solid black; } This will leave a margin of about 5px between the lower edge of the image and...
...the containing div, although there are no paddings or margins set, and there's no whitespace. The reason is, the image will vertically align baseline, and the space below the...
...To fix this error upgrade your project's ruby version or install the last supported version of Bundler for Ruby < 2.3: gem install bundler -v '~>1' You will also see...
Starting from 4.1, Rails automatically detects the inverse of an association, based on heuristics. Unfortunately, it does not seem to notify you when it fails to infer the :inverse_of...
...so you are better off to always manually set :inverse_of anyway. Note that automatic inverse detection only works on has_many, has_one, belongs_to associations. Extra options on...
...version to be compatible with Rails 2 was 0.8.6: While there are 1.8/1.9 switches in the original code, one essential fix for Ruby 1.9's API change of Module.const...
...defined? was missing. [2] Changes for replica sets were reverted (since their tests were not passing) and some tests were fixed...
Mobile browser's ignore the autoplay attribute on and elements. Stupid reasons include saving mobile bandwidth on behalf of the user and/or securing app store sales. Audio and video elements...
...the result of a user interactions (click, touch). A workaround is to have a "start button" in your application that loads and plays an initial sound. You can now play...
If you are using VNC to run Selenium tests, it may be hard to see what's going on since by default there is no list of open windows and...
...Alt+Tab won't work. Solving that is easy: Install a panel of your choice (like lxpanel) which offers task switching: sudo apt-get install lxpanel (You can't use...
Angular's location provider stalls links to the current URL, i.e. window.location. As soon as the $location service is activated in an Angular app, it will intercept links. The click...
...your interaction with the browser history (i.e. you're just using Angular as JS sugar on your page), Angular will create the above issue as soon as you use anything...
If you use Amazon AWS cloud services you definitively want to utilize software raid for IO intensive stuff such as database data directories and the like. Here's how you...
Create some EBS volumes within management console or sudo mdadm --create -f /dev/md0 --chunk=256 --level 10 --raid-devices 4 /dev/sdf /dev/sdg /dev/sdh /dev/sdi Create a fs on...
If some of your JavaScripts fail on Internet Explorer, but only in staging or production environments, chances are that JavaScript compression is the culprit. By default, Rails 3.2 compresses JavaScript...
...with UglifyJS. I have seen a few cases where this actually breaks functioning JavaScript on IE (one example is the CKEditor). I fixed this by switching to Yahoo's YUI...
Capybara has a global option (Capybara.ignore_hidden_elements) that determines whether Capybara sees or ignores hidden elements. Prefer not to change this global option, and use the :visible...
...and web-applications with real browsers. Capybara has a driver for Selenium that wraps around selenium-webdriver which is a Ruby binding to remote control real browsers via Selenium's...