multiple CSS class/id names using Ruby on Rails 3 form helpers
I am attempting to pass 2 classes to an element in a rails 3 application and having some issues with encoding.
<td class="edit">
<%= link_to 'Edit', edit_link_url(link, :class => 'edit_link ui') %><br />
<%= link_to 'Delete', link_url(link, :class =>'delete_link ui'), :confirm => 'Are you sure?', :method => :delete %>
</td>
can someone offer some insight on the best way to pass 2 classes to an开发者_StackOverflowd element in RoR.
The current output in edit_link+ui
Thanks in advance.
Remove them from the params of the link.
<%= link_to('Edit', edit_link_url(link), :class => 'edit_link ui') %><br />
<%= link_to('Delete', link_url(link), :class =>'delete_link ui', :confirm => 'Are you sure?', :method => :delete) %>
Looks like a brackets problem. The class should be applied to the link_to not the url helper.
精彩评论