現在我有部分導航看起來像這樣(X10按鈕)...Rails:處理導航的優雅方式?
<% 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 %>
是否有這樣做的更優雅/乾的解決方案?
什麼是TARGETS? – DaMainBoss 2012-03-09 11:44:44