rails tutorial from http://objectsonrails.com/