2

我将如何在此处指定 :class => "" ?:

<li><%= link_to "#" current_user  %></li>

4

2 回答 2

2
<li><%= link_to "#", current_user, :class => "class-name"  %></li>
于 2012-05-16T03:49:30.543 回答
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

于 2012-05-16T04:00:44.097 回答