Change Cancel link to link to book_path if book.id exists, otherwise to  books_path (due to change we found in Rails 4.1 ).