chapter 3 of Hartl Rails tutorial