chapters 3+5 on the ruby.railstutorial.org site