2016-02-27 46 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;' %> –

相關問題