Two level Navigational menus

This has turned out to be a bit more difficult than I anticipated. I
thought that creating two levels of generic navigational menus should
not be that difficult. May be I am missing something. I have done it
by borrowing code from various sources and modifying it. Still, the
code is not clean and I don’t like what I have. The complication comes
from keeping the parent tabs selected when the child tabs are clicked on
and then links, e.g., show, edit, destroy are clicked on the forms that
are displayed. Another complication comes from having first level menu
forms that have links that use display forms from other menu choices.

I did a lot of research on github for available sources/plugins and
found a few but either they are single level menus which do not maintain
the parent/child relationships between two level menus or if they do,
make it a rocket science (at least for me). I am looking for something
simple like Tim H.'s role_requirements plugin which is very easy to
understand, does the job, and is a joy to read his code and learn from

I have looked at the following on github:

Navigation Helper - Of all, I like the API and code the best for this
plugin, but it does not have support of nested menus: Here is the link
on github:

Symantic-Menu - This has everything I need, but unfortunately does not
work. I sent a query to the author who has not responded. Here is the
link on github:

Easy Navigation - Again meets the requirements, but I found it hard to
understand. The author does not have tests for this plugin. Here is
the link on github:

Rails Widgets - this is a rather comprehensive set of UI components one
of which is TabNav. I did something similar for my implementation which
has not turned out to be clean as I mention above. Therefore I am
reluctant to dive into it and invest a lot of time in it. Here is the
link on github:

I would appreciate it if someone can point me to a rather simple and
clean implementation of tabbed menu navigation. For my requirements, a
two level deep menus would suffice. It should have the flexibility to
specify the current tab to be hi-lighted and specifying the classes for
the CSS styling. Also, if someone has successfully used one of the
aforementioned plugins and can share sample code that would be nice too.

Sorry for the long post and thanks for your time.


Why are you expecting a rails plugin to provide an xhtml navigation
menu? Why not just implement the drop down menu using simply xhtml
(lists) and css?

Try this:


If you want to get fancy (and you use jQuery), try this:



On Mar 28, 5:32 pm, Bharat R. [email protected]

I am using jQuery now and am interested in using Superfish. Can you
point me to a working example of Superfish and RoR integration?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs