Finish rails chapter 3

Finish rails chapter 3