Sha256: dbf9028047dbf220638765e5174a8b3b9a385582fd6faa66ceeaa8dd7a65c2be

Contents?: true

Size: 1.63 KB

Versions: 12

Compression:

Stored size: 1.63 KB

Contents

<p id="notice"><%= notice %></p>

<h1>Listing Auth Shopping Products</h1>

<table>
  <thead>
    <tr>
      <!-- id number, this will also hold links to edit and destroy. -->
      <th>Number</th>
      <th>Id Number</th>
      <!-- get the names of the other fields to be shown-->
      <% @auth_shopping_products.first.attributes_to_show.each do |attr| %>
        <th><%= attr %></th>
      <% end %>
    </tr>
  </thead>

  <tbody>
    <% @auth_shopping_products.each_with_index {|auth_shopping_product,key| %>
      <tr>
        <td><%= key + 1 %></td>
        <td>
          <div>
            <%= link_to auth_shopping_product.id.to_s, product_path(auth_shopping_product) %>
          </div>
          <div>
            <!-- add destory and edit options here -->
            <!-- end -->
            <span><%= link_to 'Edit', edit_product_path(auth_shopping_product) %></span>
            <span><%= link_to 'Destroy', product_path(auth_shopping_product), method: :delete, data: { confirm: 'Are you sure?' } %></span>
            <!-- here how to show a button, and how to change the form id's so that it uses the object id, -->
            <span>
              <% @auth_shopping_cart_item = create_cart_item_from_product(auth_shopping_product) %>
              <%= render :partial => "auth/shopping/cart_items/form.html.erb", locals:{show_fields: "no"} %>
            </span>
          </div>
        </td>
        <% @auth_shopping_products.first.attributes_to_show.each do |attr| %>
          <td><%= auth_shopping_product.send("#{attr}") %></td>
        <% end %>
      </tr>
    <% } %>
  </tbody>
</table>

<br>

<%= link_to 'New Product', new_product_path %>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
wordjelly-auth-1.1.0 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-1.0.9 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-1.0.8 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-1.0.5 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-1.0.4 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-1.0.3 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-1.0.2 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-0.0.8 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-0.0.5 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-0.0.4 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-0.0.3 app/views/auth/shopping/products/index.html.erb
wordjelly-auth-0.0.1 app/views/auth/shopping/products/index.html.erb