Remember how Rails 2 came with an awesome feature that broke all code using Time.now or Time.parse? This behavior is...
Simple: Tell the application controller how to handle exceptions, here a RecordNotFound error. Do this with the following line: # application_controller.rb...
When writing a piece of reusable code, you sometimes need to have separate code for Rails 2 and Rails 3...
While it might seem trivial to implement an invoice that sums up items and shows net, gross and vat totals...
I recently browsed through the ActiveSupport code and found some nice stuff I did not know about: ActiveSupport::Callbacks
When the Ruby parser module of Ruby-GetText comes across a file in one of its search directories (e.g. lib/scripts...
Open up your "Base File.sublime-settings" (Preferences Menu → File Settings – User) in Sublime Text 2. Add entries for font_face...
Hint: There's another card with this helper for Cucumber features. Sometimes you feel like you need to stub some...
When you need to create a locale for a language variant (like Austrian for German), you probably don't want...
Passenger gives you the possibility to define in which environment your app should be started. This has to be added...
When you have a program running in a hidden X screen (like with Xvfb for Selenium tests) you may want...
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...
In Rails 2, you could use link_to_remote...
...:update => 'id' to automatically replace the content of $('#id').
This finally works: User.any_instance.should_receive(…) as does User.any_instance.stub(…) Note: You won't have RSpec 2.6 if you're still working...
Sometimes you need a file of some size (possibly for testing purposes). On Linux, you can use dd to create...
Note: Consider using MATE instead of Gnome 3 on newer system Awesome is a very good tiling window manager that...
When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...
The first thing to do with any new U2410 should be to disable the incredibly annoying beep when pressing any...
When you render a nested form for a Movie which has_many :actors, you want to render the right number...
In shell scripts you can use $1 to refer to the first argument, $2 for the second, etc. If you...
This card explains how to upgrade an existing RubyMine installation to a newer version. If you're installing RubyMine for...
When rendering a number, you want to pretty up the string coming from #to_s: Render 0.0 as 0
Because your examples should not change global state, you should not need to care about the order in which RSpec...
I encountered a bug in RSpec 1.x where stubbed class methods ("static methods") would not be unstubbed before the...