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