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
Use the current_page? helper to determine whether or not you should assign the "current" class. For example:
"current"
<%= 'active' if current_page?(home_about_path) %>
Note you can also pass a path (not only a hash of options), e.g: current_page?(root_path).
current_page?(root_path)