Ruby on Rails: how do I add an HTML class parameter to this link?
<% link_to :controller => :menu_bars, :action => :select do %>
<div class="action_box right">
Manage Menu Bars
</div>
<% end %>
I've never been able to figure out the syntax for the documentation... so... here I am.
I want it to render something like <开发者_如何学运维a ... class="myclass">
...
<% link_to({:controller => :menu_bars, :action => :select}, :class => "myclass") do %>
<div class="action_box right">
Manage Menu Bars
</div>
<% end %>
<a href="/countries/new" class="myclass">
<div class="action_box right">
Manage Menu Bars
</div>
</a>
精彩评论