I have some static pages in a navigation menu. I want to add a class like "current" to the item which is currently displaying.
The way I am doing so is to add tons of helper methods (each for one item) to check the controller and action.
def current_root_class
'class="current"' if controller_name == "homepage" && action_name == "index"
end
<ul>
<li <%= current_root_class %>><%= link_to "Home", root_path %>
Is there any better way to do so!? My current way is so stupid......