following along with chapter 9 of Rails 4 in Action