from Hartl's RoR Tutorial (Ch. 3)