app/views/variants/index.html.erb

Summary

Maintainability
Test Coverage
<section class="content-header">
</section>
<section class="content">
  <div class="box">
    <div class="box-header">
      <h3 class="box-title">Variants</h3>
      <div class="box-tools pull-right">
        <div class="btn-group">

          <%= link_to "Add Variant", new_product_variant_path(@product.id), class: "btn btn-primary" %>
        </div>
      </div>
    </div>
    <div class="box-body">
      <div class="">
        <table class="table" id="users-table" data-source="<%= users_path(format: :json)%>" >
          <thead>
            <tr>
              <th> Title </th>
              <th> SKU </th>
              <th> Type </th>
              <th> Status </th>
              <th> Actions </th>
            </tr>
          </thead>
          <tbody>
            <% @variants.each do |variant| %>
              <tr>
                <td><%= variant.title %></td>
                <td><%= variant.sku %></td>
                <td><%= variant.variant_type.humanize %> </td>
                <td><%= variant.status.humanize %> </td>
                <td><%= render "actions", variant: variant %> </td>
              </tr>
            <% end %>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</section>