Ruby on Rails - navigation tree

Hi, folks,

I am trying to build a beautiful navigation tree, to help users browse
through an inherently hierarchical website. Looking for the
appropriate control, I chose the yui treeview (javascript). There is a
site describing how to adjust it to Ruby on Rails
(http://sonjayatandon.com/07-2006/how-to-get-rails-and-the-yahoo-user-interface-yui-to-talk-part-1/
etc.).
I also want to add a custom right-click context menu
(http://developer.yahoo.com/yui/examples/menu/treeviewcontextmenu.html).
I followed the directions, and they work OK, however, it does not
escape my attention that I am using Ruby to hardcode javascript. Is
there another, more elegant, way to do this?

Thanks,
Xenia , new to Ruby and Rails

I also want to add a custom right-click context menu
(http://developer.yahoo.com/yui/examples/menu/treeviewcontextmenu.html).
I followed the directions, and they work OK, however, it does not
escape my attention that I am using Ruby to hardcode javascript. Is
there another, more elegant, way to do this?

You could include it as a separate .js file
http://www.google.com/search?client=opera&rls=en&q=how+to+include+a+js+file&sourceid=opera&ie=utf-8&oe=utf-8

Note also that the rails group might be more helpful since some of us on
this list don’t use rails as often as they.
=r