Chapter 2 of ruby.railstutorial.org