I have a tab navigation and I'm trying to set the active tab based on
the page that the customer is viewing. Currently its a bunch of if
else statements, but I know there has to be a way to shorten it.

<% if request.symbolized_path_parameters[:controller] == 'main' %>
        <%= link_to 'Home', {:controller => 'main', :action => 'show' },
:class => 'active' %>
<% else %>
        <%= link_to 'Home', {:controller => 'main', :action => 'show' } %>
<% end %>

Thanks,

Ryan
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to