Sha256: 0ea79b84cd4289033c11f52fe63263a34d870bb0e06b7eaea320e7899661968f

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

<%= title t("product", scope: "activerecord.models.mechanize_store").pluralize %>

<% content_for :right do -%>
  <li class="active">
    <%= link_to t("new_product"), new_product_path %>
  </li>
<% end -%>

<table class="table table-striped">
  <thead>
    <tr>
      <th><%= sort_link @search, :id, t(:id, scope: "activerecord.attributes") %></th>
      <th><%= sort_link @search, :name, t(:name, scope: "activerecord.attributes.product") %></th>
      <th><%= sort_link @search, :price, t(:price, scope: "activerecord.attributes.product") %></th>
      <th><%= sort_link @search, :product_category, t(:product_category, scope: "activerecord.attributes.product") %></th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>

    <% @products.each do |product| %>
      <tr>
        <td><%= product.id %></td>
        <td><%= product.name %></td>
        <td><%= number_to_currency(product.price) %></td>
        <td><%= product.product_category.name %></td>
        <td>
          <%= link_to product do %>
            <i class="fa fa-file"></i>
          <% end -%>
        </td>
        <td>
          <%= link_to edit_product_path(product) do %>
            <i class="fa fa-edit"></i>
          <% end -%>
        </td>
        <td>
          <%= link_to product, method: :delete, data: { confirm: t(:are_you_sure) } do %>
            <i class="fa fa-trash"></i>
          <% end -%>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= will_paginate @products %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mechanize-store-0.0.2 app/views/mechanize_store/products/index.html.erb