<%= link_to "[Delete]", customer_path(customer.id, :customer_delete => true), :method => :delete, :data => {:confirm => "Are You Sure?"} %>
我的上述代码工作正常,
但是如何在我的视图中给我的link_to颜色说ike red?尝试了很多堆栈溢出线程但是找不到解决方案,因为我的link_to包含数据确认操作等组合功能传递参数
答案 0 :(得分:3)
为链接提供颜色属性
<强> 1。与css类的新链接
<%= link_to "[Delete]", customer_path(customer.id, :customer_delete => true), :method => :delete, :data => {:confirm => "Are You Sure?"}, :class => 'link' %>
<强> application.css 强>
.link {
color: red;
}
<强> 2。内联css样式的新链接
<%= link_to "[Delete]", customer_path(customer.id, :customer_delete => true), :method => :delete, :data => {:confirm => "Are You Sure?"}, :style => 'color: red;' %>