Code from Ruby on Rails 3 Tutorial book