bruz/bookshelf-delivery-example

View on GitHub
apps/web/templates/books/_form.html.erb

Summary

Maintainability
Test Coverage
<% unless params.valid? %>
  <div class="errors">
    <h3>There was a problem with your submission</h3>
    <ul>
      <% params.error_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
    </ul>
  </div>
<% end %>

<%=
  form_for form, {} do
    div class: 'input' do
      label      :title
      text_field :title
    end

    div class: 'input' do
      label      :author
      text_field :author
    end

    div class: 'controls' do
      submit submit_label
    end
  end
%>