Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Active Navigation Item Name
In addition to render_navigation there is another helper method called
active_navigation_item_name to just render the name of the currently active navigation item. This can be useful for example if you have a sidebar and the heading of the sidebar is always equal to the currently active secondary navigation. To achieve this you would call the helper method like this (using haml):
.sidebar %h1= active_navigation_item_name(:level => 2)
You can pass the following options to
- :level – this option determines for which level you want to render the name of the currently active navigation item. Use :level => :all to render the name of the most specific/deepest item possible. Use a specific level (e.g. :level => 1) to always render the active item name of the same level. Defaults to :all.