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
Yep! Check out this article: A Better Way to Add a ‘selected’ Class to Links in Rails
Drop nav_link_helper.rb into app/helpers and it can be as easy as:
<%= nav_link 'My_Page', 'http://example.com/page' %>
The nav_link helper works just like the standard Rails link_to helper, but adds a 'selected' class to your link (or its wrapper) if certain criteria are met. By default, if the link's destination url is the same url as the url of the current page, a default class of 'selected' is added to the link.
There's a gist here: https://gist.github.com/3279194
UPDATE: This is now a gem: http://rubygems.org/gems/nav_link_to