When you require the Ruby debugger to be available from your Rails console (e.g. you want to inspect a method...
When adding a new field to your model's database table, don't set any defaults in the database.
Oniguruma is an advanced regular expression engine for Ruby. Install Oniguruma with binary dependencies like this: sudo apt-get install...
The technique described in this card has an important caveat: The result of GROUP_CONCAT is truncated to the maximum...
You can use heredoc to avoid endlessly long lines of code that nobody can read. Heredoc strings preserve linebreaks and...
If Rails or Rake are complaining about a missing gem that is listed in your Gemfile.lock and the listed version...
Sometimes you want to use a vanilla Ruby method like a block. You can use Object#method to obtain a...
We are consistently having trouble with selenium-webdriver > 2.5.0 where whenever we try to select an option from a Capybara...
ExecJS lets you run JavaScript code from Ruby. It automatically picks the best runtime available to evaluate your JavaScript program...
The state_machine gem comes with a rake task that lets you generate PNG graphs from any model using state...
class Errormaster CoffeeIsOut = Class.new(StandardError) # is prettier than class CoffeeIsOut < StandardError; end end Reference such an error class with Errormaster...
Whenever Firefox updates, all your Cucumber features that use Selenium break. This is annoying. In order to remedy this, version...
Grit gives you object oriented read/write access to Git repositories via Ruby.
jQuery as new default Javascript library, streaming response support, attr_accessible with roles, prepared statements, easier migrations.
If you have a time given in a different time zone than your local one, parsing will convert it for...
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...
Calling Time#utc, Time#gmt or Time#localtime will not create a converted copy. Instead these methods modify the receiving...
After updating Rubygems you see a wall of deprecation warnings like this: NOTE: Gem::SourceIndex#add_spec is deprecated, use...
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...
Date::Performance is a gem that replaces various method in Ruby's Date class with fast C implementations. Unfortunately it...