2016-02-27 44 views

回答

3

为了让颜色属性以链接的CSS

1.新的链接无法找到一个解决方案类

<%= 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;' %> 
+0

有没有办法给它内嵌于不使用类的link_to新的链接? –

+0

是的,试试这个: –

+0

<%= link_to“[删除]”,customer_path(customer.id,:customer_delete => true),:method =>:delete,:data => {:confirm =>“Are You好吗?“},:style =>'color:red;' %> –

相关问题