chapter 2 from <Ruby On Rail Tutorial>