现在我有一个导航部分,看起来像这样(x10个按钮)...
<% if current_controller == "territories" %>
<li><%= link_to "Territories", {:controller => territories }, :class => active %></li>
<% else %>
<li><%= link_to "Territories", {:controller => territories } %></li>
<% end %>
<% if current_controller == "contacts" %>
<li><%= link_to "Contacts", {:controller => Contacts }, :class => active %></li>
<% else %>
<li><%= link_to "Contacts", {:controller => Contacts } %></li>
<% end %>
有没有更优雅/干燥的解决方案来解决这个问题?