Exercise from chapter 2 in Michael Hart's rails tutorial