3rd exercise from https://www.railstutorial.org.