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...
Git has a built-in repository viewer for your web browser. a bit similar (but less awesome) than github.
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:
Web fonts are awesome. After being restricted to Arial for two decades there is finally a cross-browser way to...
By default, Rails views escape HTML in any strings you insert. If you want to insert HTML verbatim, you need...
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...
Using the jQuery adapter breaks the built-in save function of CKEditor. Phenomenon: The page is submitted correctly, but the...
Generally for nested forms, a blank form is placed below all other existing object forms. If you would like to...
Recently, we had an interesting lunch-break with the rails 3.1. asset-pipeline in production mode. Daniel Zahn made a...
You can use the step definition below to say this: Then the "Last name" field should have an error
You can use heredoc to avoid endlessly long lines of code that nobody can read. Heredoc strings preserve linebreaks and...
Simple: Tell the application controller how to handle exceptions, here a RecordNotFound error. Do this with the following line: # application_controller.rb...
Ever wondered how Rails talks to itself in a Cucumber feature? In Rails 3 you can do it like this...
Do you have page caching enabled for the development environment and there are cached pages lying around in public/?
I believe that when WEBrick has trouble bringing up your Rails application, the WEBrick component that is supposed to print...
If you have any class which requires access to some path methods generated by your routes. Even though you could...
While it might seem trivial to implement an invoice that sums up items and shows net, gross and vat totals...
You've been there: A form cannot be submitted, but you don't see a validation error because the field...