【问题标题】:How to rewrite deleting link_to helper to use it with glyphicon icon?如何重写删除 link_to 助手以将其与 glyphicon 图标一起使用?
【发布时间】:2015-07-22 22:43:23
【问题描述】:

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

   <%= link_to 'Delete', user_task_path(current_user, task.id),
        data: { confirm: 'Are you sure?' }, :method => :delete, remote: true %>

【问题讨论】:

    标签: ruby-on-rails glyphicons


    【解决方案1】:

    试试这个

        <%= 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 %>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-26
      • 2018-04-28
      • 1970-01-01
      • 2010-09-23
      相关资源
      最近更新 更多