【发布时间】:2019-02-28 13:04:52
【问题描述】:
我在 Spree 应用中从购物车按钮中删除产品时遇到问题。 我有一个购物车,有部分 _line_item.html.erb:
<%= order_form.fields_for :line_items, line_item do |item_form| %>
<tr class="first odd">
<td class="image"><a class="product-image" title="Sample Product" href="#/women-s-crepe-printed-black/">
<% if variant.images.length == 0 %>
<%= link_to small_image(variant.product), variant.product %>
<% else %>
<%= link_to image_tag(variant.images.first.attachment.url(:small)), variant.product %>
<% end %>
</td>
<td><h2 class="product-name">
<%= link_to line_item.name, product_path(variant.product) %>
</h2>
</td>
<td class="a-center"><a title="Edit item parameters" class="edit-bnt" href="#configure/id/15945/"></a></td>
<td class="a-right"><span class="cart-price"> <span class="price">
<%= line_item.single_money.to_html %></span> </span>
</td>
<td class="a-center movewishlist">
<%= item_form.number_field :quantity, min: 0, class: "form-control line_item_quantity", size: 5 %>
</td>
<td class="a-right movewishlist"><span class="cart-price"> <span class="price">
<%= line_item.display_amount.to_html unless line_item.quantity.nil? %></span> </span>
</td>
<td class="a-center last cart-item-delete ">
<%= link_to content_tag(:span, '', class: 'glyphicon glyphicon-minus-sign'), '#', class: 'delete', id: "delete_#{dom_id(line_item)}" %>
</td>
</tr>
<% end %>
最后一个表格单元格是指从购物车按钮中删除产品,但是当点击该购物车时没有任何反应
<%= link_to content_tag(:span, '', class: 'glyphicon glyphicon-minus-sign'), '#', class: 'delete', id: "delete_#{dom_id(line_item)}" %>
【问题讨论】:
-
它无处链接(因为'#'),也许它应该与js一起使用?我对狂欢一无所知,但这样的链接不起作用
标签: ruby-on-rails ruby spree