使用带有button_to“删除”的引导图标在轨道3 [英] Using bootstrap icons with button_to "delete" in rails 3

查看:154
本文介绍了使用带有button_to“删除”的引导图标在轨道3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个编辑按钮:

<%= link_to edit_income_path(trans), class: "btn btn-default" do %>
<i class="glyphicon glyphicon-pencil"></i>
<% end %>

我想要一个删除按钮看起来和这个图标一样:glyphicon glyphicon-trash,找不到合适的语法,使其工作和外观一样。我的删除按钮现在:

And I want a delete button to look the same with this icon: glyphicon glyphicon-trash, but I can't find the right syntax to make it work and look the same. My delete button now:

<%= button_to "delete", trans, :method=> :delete, :remote=> true %>

推荐答案

试试这个...例如链接 _to

try this...for example with link_to

<%= link_to (‘<i class="fa fa-thumbs-up fa-lg"> </i>’).html_safe, vote_path(@image), :method=> :delete, :remote=> true%>

这篇关于使用带有button_to“删除”的引导图标在轨道3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆