This is from the Ch#2 of Micheal Hartl's book for RoR 4 development