Chapter 3+ of ruby on rails tutorial