Chapter 3 of Hartl's Rails book...