Simon Courtois edited this page May 2, 2014 · 3 revisions

simple-navigation is a ruby library for creating navigations (with multiple levels) for your Rails, Sinatra or Padrino applications.

Some of the key features include:

  • define your navigation in a config file, not inside the views
  • create as many navigation levels as you like
  • render all your navigation levels as a nested tree or render each level separately
  • automatic highlighting of the active navigation item

How does it work?

simple-navigation basically works like this:

  • You define your navigation with all its levels in the config-file (default: config/navigation.rb)
  • In the view you render your configured navigation using the helper-method render_navigation

By default the navigation is rendered as an HTML list. You can style the list according to your needs using CSS (or SASS, of course).

If you don't want to render your navigation as HTML list, you can extend the plugin by providing your own renderer or you can use one of the other built-in renderers. See Rendering for more details.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.