following tutorial: http://www.railstutorial.org/book/beginning#cha-beginning