example code of "Agile Web Development with Rails 4"