From the book Rails 4 in Action