我如何指定:class => “”这里?:
<li><%= link_to "#" current_user %></li>
TY
答案 0 :(得分:2)
<li><%= link_to "#", current_user, :class => "class-name" %></li>
答案 1 :(得分:1)
检查以下内容,
<%= link_to "Articles", articles_path, :id => "news", :class => "article" %>
# => <a href="/articles" class="article" id="news">Articles</a>
有关详情,请查看: - http://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to