Chap 2 of railstutorials.org