css - 在 rails 3 中使用带有 button_to "delete"的 Bootstrap 图标

标签 css ruby-on-rails ruby ruby-on-rails-3 twitter-bootstrap

我有这个编辑按钮:

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

而且我希望删除按钮看起来与此图标相同:glyphicon glyphicon-trash,但我找不到正确的语法来使其工作并看起来相同。我现在的删除按钮:

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

This is what it looks like

最佳答案

这就是您要找的东西吗??

<%= button_to trans, method: :delete, remote: true, class: "btn btn-default" do %>
  <span class="glyphicon glyphicon-trash"></span>
<% end %>

关于css - 在 rails 3 中使用带有 button_to "delete"的 Bootstrap 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25309599/

相关文章:

javascript - 移动优化 : Make notification menu with position:absolute scrollable

html - 通过使用 <p> 和一些 CSS 转换旋转文本,使文本换行

ruby-on-rails - Rails 辅助方法 :attribute_changed? 在 Rails 3.2.15 中如何工作?

ruby - 为 Elasticbeanstalk 单实例 Passenger 配置 SSL

ruby - 在 Ruby 中围绕居中文本放置一个框

html - 悬停图像时除了不透明度之外我还能使用什么?

javascript - 如何用相似的js代码控制多个表单域

sql - Rails : update multiple attributes without validation, 1 sql 事务

ruby-on-rails - 如何在 RSPEC 中多次重复使用相同的测试

ruby-on-rails - rails : overriding model name in params