from michael hartl's rails tutorial (this time I'll hopefully understand it)