from RoR online pdf tutorial (Hartl)