code from blog tutorial: http://guides.rubyonrails.org/getting_started.html