Rails Tutorial, chapter 3.