在购物车中定制一个x

时间:2020-12-23 23:34:54

I am trying a custom red x in my table as shown below. 在购物车中定制一个x.

我正在我的表中尝试一个定制的红色x,如下所示。

In my html I have

在我的html中。

<td>$4.99</td>
<td><%= link_to 'Remove', purchase_path(a), method: :delete, data: {confirm: 'Are you sure?'} %></td

I want to replace the word 'Remove' with the x. I am having trouble how to go about this while keeping the link_to in place.

我想用x来替换“Remove”这个词,我在保持link_to的位置上遇到了麻烦。

1 个解决方案

#1


1  

try this :

试试这个:

<%= link_to  purchase_path(a), method: :delete, data: {confirm: 'Are you sure?'} do %>
  YOUR ICON HERE
<% end %>

#1


1  

try this :

试试这个:

<%= link_to  purchase_path(a), method: :delete, data: {confirm: 'Are you sure?'} do %>
  YOUR ICON HERE
<% end %>