Code written while reading railstutorial.org