codemy/writefully

View on GitHub
app/views/admin/posts/_form.html.erb

Summary

Maintainability
Test Coverage
<%= form_for [:admin, @post] do |f| %>
  <div class='form-group'>
    <%= f.label :title %>
    <%= f.text_field :title, class: 'form-control' %>
  </div>
  <div class='form-group'>
    <%= f.label :body %>
    <%= f.text_area :body, class: 'form-control' %>
  </div>
  <div class='form-group'>
    <%= f.collection_check_boxes :tag_ids, Tag.all, :id, :name do |t| %>
      <div class='checkbox'>
        <%= t.label do %>
          <%= t.check_box + t.text %>
        <% end %>
      </div>
    <% end %>
  </div>
  <div class='form-group'>
    <%= f.submit "Save", class: 'btn btn-block btn-success' %>
  </div>
<% end %>