In order to save the original value of a constant, set the new value and restore the old value after...
Tooltips that are delivered through HTML attributes are encoded. Decode entities before checking for their presence. Capybara: Then /^there should...
Some helpers for poking around at your Capybara driven browser's cookies in integration tests. Supports Capybara's bundled drivers...
You can use text-overflow to truncate a text using CSS but it does not fit fancy requirements.
When using Rails to truncate strings, you may end up with strings that are still too long for their container...
The step definition below lets you say: Then I should see a field "Password" But I should not see a...
Most of the JavaScript snippets have code that manipulates the DOM. For that reason dom manipulating javascript code should have...
Views are normally (for good reason) not rendered in controller specs. If you need it to happen, use:
I have no idea how it's supposed to work (or why the don't have a print CSS), but...
Though Internet Explorer 9 supports the box-shadow CSS property there is a nasty bug which sometimes prevents it from...
When you print out a HTML pages, all raster images (like PNGs) will appear aliased. This is because a printer...
Although it's tempting flirt with detecting mobile/touch devices with CSS media queries or Javascript feature detection alone, this approach...
When you're getting this error, one possibility is that you've created a select field for an association instead...
One of the most common production errors are ActionController::MethodNotAllowed errors. They usually happen when someone reloads a form by...
Submit buttons in Rails come with a useful option :disable_with which will disable the button when clicked and change...
When you use one line Ruby comments in ERB templates you should never do this (notice the whitespace in front...
Since Firefox 8 it is possible to define custom context menus (right clicking) with HTML markup.
If you would like to use language specific layout (e.g. background-images) in your applications stylesheets you can achieve this...
In order to prevent the browser from asking whether to remember the password, give a form an autocomplete attribute with...
Forms with many inputs (600+ in my case) become extremely unresponsive on an iPad, up to the point where it...
There are several options, but most of them are impractical. The best way is to use the :ruby filter:
Back in the war, Rails developers had to manually HTML-escape user-supplied text before it was rendered in a...
Clearfix is a hack to clear floating elements without additional HTML markup. If you only need to support IE8 and...
RSpec 1 (Rails 2) With the most recent spec_candy.rb helpers you can say: User.stub_any_instance(:foo => :bar) user = User.new...