drhenner/ror_ecommerce

View on GitHub
app/views/admin/merchandise/brands/index.html.erb

Summary

Maintainability
Test Coverage
<%= render :partial => '/admin/merchandise/sub_header'%>

<div class='admin_title_header'>
  <h3>Brands</h3>
  <%= link_to "New Brand", new_admin_merchandise_brand_path, class: 'button' %>
</div>

<div class="admin_brands">
  <table class='hover'>
    <thead>
    <tr class='odd'>
      <th class='column1_header'>Name</th><th></th><th></th>
    </tr>
    </thead>
    <% for brand in @brands %>
      <tr class='<%= cycle("odd", "")%>'>
        <td><%= link_to brand.name, admin_merchandise_brand_path(brand) %></td>
        <td><%= link_to "Edit", edit_admin_merchandise_brand_path(brand) %></td>
        <td><%= link_to "Delete", admin_merchandise_brand_path(brand),  data: { confirm: 'Are you sure?' }, method: :delete %></td>
      </tr>
    <% end %>
  </table>
</div>