from tutorial at http://ruby.railstutorial.org/chapters/a-demo-app#top