my code from the exercise in RailsCast #327