From chapter 2 of Michael Hartl's Ruby on Rails Tutorial