<%= form_with(model: book, local: true) do |form| %> <% if book.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(book.errors.count, "error") %> prohibited this book from being saved:</h2> <ul> <% book.errors.full_messages.each do |message| %> <li><%= message %></li> <% end %> </ul> </div> <% end %> <div class="actions"> <%= form.submit %> </div> <% end %>