from the ruby rails tutorial