开发者

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>  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜