Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何将删除链接_重写为帮助器以与glyphicon图标一起使用?_Ruby On Rails_Glyphicons - Fatal编程技术网

Ruby on rails 如何将删除链接_重写为帮助器以与glyphicon图标一起使用?

Ruby on rails 如何将删除链接_重写为帮助器以与glyphicon图标一起使用?,ruby-on-rails,glyphicons,Ruby On Rails,Glyphicons,我希望我不吸引人的删除链接变成一个glyphicon图标。如何重写以下代码 <%= link_to 'Delete', user_task_path(current_user, task.id), data: { confirm: 'Are you sure?' }, :method => :delete, remote: true %> :删除,远程:真%> 试试这个 <%= link_to user_task_path(current_

我希望我不吸引人的删除链接变成一个glyphicon图标。如何重写以下代码

   <%= link_to 'Delete', user_task_path(current_user, task.id),
        data: { confirm: 'Are you sure?' }, :method => :delete, remote: true %>
:删除,远程:真%>
试试这个

    <%= link_to user_task_path(current_user, task.id), method: :delete, data: { confirm: 'Are you sure?' }, remote: true do %>
      <i class="glyphicon glyphicon-trash"></i>
    <% end %>