Sha256: d6850b03fa3a1a0f7762fc87a24eb2f88d89e03d8bf3c53b1905aeed21bffcad

Contents?: true

Size: 1.69 KB

Versions: 59

Compression:

Stored size: 1.69 KB

Contents

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

<h1>Listing Auth Shopping Cart Items</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_cart_items.first.attributes_to_show.each do |attr| %>
        <th><%= attr %></th>
      <% end %>
    </tr>
  </thead>

  <tbody>
    <% @auth_shopping_cart_items.each_with_index {|auth_shopping_cart_item,key| %>
      <tr>
        <td><%= key + 1 %></td>
        <td>
          <div>
            <%= link_to auth_shopping_cart_item.id.to_s, cart_item_path(auth_shopping_cart_item) %>
          </div>
          <div>
            <!-- add destory and edit options here -->
            <!-- end -->
            <span><%= link_to 'Edit', edit_cart_item_path(auth_shopping_cart_item) %></span>
            <span><%= link_to 'Remove from wish list', cart_item_path(auth_shopping_cart_item), method: :delete, data: { confirm: 'Are you sure?' } %></span>
          </div>
        </td>
        <% @auth_shopping_cart_items.first.attributes_to_show.each do |attr| %>
          <td><%= auth_shopping_cart_item.send("#{attr}") %></td>
        <% end %>
      </tr>
    <% } %>
  </tbody>
</table>

<br>

<!--- form to create a cart -->
<% @auth_shopping_cart = Auth.configuration.cart_class.constantize.new 
   @auth_shopping_cart.add_cart_item_ids = @auth_shopping_cart_items.map{|c| c = c.id.to_s}
   @auth_shopping_cart.remove_cart_item_ids = []
%>
<%= render :partial => "auth/shopping/carts/form.html.erb", locals:{show_fields: "no"} %>

<!-- end form -->

<%= link_to 'Add Another Item to the Wish List', new_cart_item_path %>

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
wordjelly-auth-1.6.0 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.5.9 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.5.8 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.5.7 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.5.6 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.5.5 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.5.4 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.5.3 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.5.2 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.5.1 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.5.0 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.4.9 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.4.8 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.4.7 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.4.6 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.4.5 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.4.4 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.4.3 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.4.2 app/views/auth/shopping/cart_items/index.html.erb
wordjelly-auth-1.4.0 app/views/auth/shopping/cart_items/index.html.erb