# Two level Navigational menus

**URL:** <https://www.ruby-forum.com/t/two-level-navigational-menus/164160>\
**Category:** Rails\
**Created:** [March 28, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/two-level-navigational-menus/164160 "2009-03-28T23:32:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [March 28, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/two-level-navigational-menus/164160/1 "2009-03-28T23:32:11Z")

</div>

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  
it.

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:

> **[GitHub - rpheath/navigation\_helper: Rails plugin: provides automatic navigation...](https://github.com/rpheath/navigation_helper/tree/master)**
>
> master

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:

> **[GitHub - danielharan/semantic-menu: A plugin to make rails menus easier to write](https://github.com/danielharan/semantic-menu/tree/master)**
>
> master

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:

[http://github.com/innetra/easy\_navigation/tree/master](http://github.com/innetra/easy_navigation/tree/master)

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:

[http://wiki.github.com/paolodona/rails-widgets/tabnav](http://wiki.github.com/paolodona/rails-widgets/tabnav)

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.

Bharat

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [March 30, 2009, 8:04pm UTC](https://www.ruby-forum.com/t/two-level-navigational-menus/164160/2 "2009-03-30T20:04:24Z")

</div>

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:

> **[Droplet Web Plugin](https://www.lwis.net/droplet/)**
>
> A CSS and JavaScript driven info browser for your website

Specifically:

> **[Droplet Web Plugin](https://www.lwis.net/droplet/)**
>
> A CSS and JavaScript driven info browser for your website

If you want to get fancy (and you use jQuery), try this:  
[http://users.tpg.com.au/j\_birch/plugins/superfish/](http://users.tpg.com.au/j_birch/plugins/superfish/)

Specifically:  
[http://users.tpg.com.au/j\_birch/plugins/superfish/#sample4](http://users.tpg.com.au/j_birch/plugins/superfish/#sample4)

HTH.

On Mar 28, 5:32 pm, Bharat R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [May 12, 2009, 5:10pm UTC](https://www.ruby-forum.com/t/two-level-navigational-menus/164160/3 "2009-05-12T17:10:56Z")

</div>

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