2016-11-10 45 views
0

我怎麼可能會添加CSS來此:定製button_to

<h9>Sunday</h9> 
    <% @sunday.each do |chorelist| %><br> 
    <p2><%= chorelist.name %></p2> 
    <%= button_to "Delete", chorelists_destroy_path(id: chorelist.id), 
     class:"btn btn-space" %> 
    <% end %> 

我不知道在那裏我可以添加一個div類或按鈕類。 (我還是比較新的Rails。)

謝謝!

+4

可能重複的[Rails按鈕\ _to - 應用css類按鈕](http://stackoverflow.com/questions/14123884/rails-button-to-applying-css-class-to-button) – jamesjaya

+0

你是什麼嘗試在其中實現? – uzaif

+0

您可能想要嘗試檢查瀏覽器中的按鈕,以查看可以使用CSS訪問的按鈕的元素 – angkiki

回答

0

使用這樣的事情在your_file.html.erb,

<style> 
    // do ur styling. 
</style> 

或在資產/樣式表中把它添加新的文件your_file.css寫的風格,不要忘記在application.css這個文件