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/?
jQuery as new default Javascript library, streaming response support, attr_accessible with roles, prepared statements, easier migrations.
I believe that when WEBrick has trouble bringing up your Rails application, the WEBrick component that is supposed to print...
When writing a piece of reusable code, you sometimes need to have separate code for Rails 2 and Rails 3...
If you have any class which requires access to some path methods generated by your routes. Even though you could...
You've been there: A form cannot be submitted, but you don't see a validation error because the field...
Rails doesn't know which host it is running on. For generating links, it strips the hostname off the request...
After updating Rubygems you see a wall of deprecation warnings like this: NOTE: Gem::SourceIndex#add_spec is deprecated, use...
Sometimes the Rails helper #distance_of_time_in_words is using too much magic. When you need a time difference...
Detecting if a Javascript is running under Selenium WebDriver is super-painful. It's much easier to detect the current...
Hint: There's another card with this helper for Cucumber features. Sometimes you feel like you need to stub some...
tl;dr: Always have your attachment path start with :rails_root/storage/#{Rails.env}#{ENV['RAILS_TEST_NUMBER']}/. The directory where you...
When you need to create a locale for a language variant (like Austrian for German), you probably don't want...
When you need to use diff in either some Ruby code or your Rails app, use the differ gem.
Code example for implementing Cross-Origin Resource Sharing (CORS) in Rails.
To offer files for download, use send_file. def download(file) send_file file.path, :disposition => 'attachment' end
Passenger gives you the possibility to define in which environment your app should be started. This has to be added...
The Javascript code below is a rough equivalent to the simple_format helper that ships with Rails: function simpleFormat(str...
Resque comes with its own dashboard (Resque server) that you can mount inside your Rails 3 application with #config/routes.rb:
Note: If you are currently working with Ruby 1.8.7 or 1.9.3, we recommend to upgrade to Ruby 2.1 first. From...
This note describes how to kick a user out of a Rails application after she hasn't requested an action...
When you create a temporary file (e.g. to store a generated Excel sheet) and try to send it to the...
In Rails 2, you could use link_to_remote...
...:update => 'id' to automatically replace the content of $('#id').