from rails tutorial Michael Hartl