Update code examples to Ruby 2 and Rails 3.