Lost in AJAX with rails

I am trying to create a menu for navigation that starts out as


and when you click on one of the groups it brings up one of the model
tables you can navigate to.


== Model1
== Model2
== Model3


This is created with two helper methods and the partial _menu.rhtml.
I was wondering how to start to migrate this to ajax. I tried
creating an rjs file but I don t understand the structure and how it
is called in the context of rails.

If anyone could help me I would really appreciate it.

White Wizzard

I have gotten a little further, I now have the rjs script
executing . . . but the problem now is that I have many controllers
and I want the action to call the function in application.rb, but it
seems that it can't find it if it is in the application controller. Is
there a way around this somehow?

<%= link_to_remote( mg.group_name, :update => "menu", :url => {:action
=> [:menu]}) unless ms.first.nil? %>

other wise this works as I expect it.

Any help is appreciated.
White Wizzard

%= link_to_remote( mg.group_name, :update => "menu", :url =>
{:controller => "application", :action
=> "menu"}) unless ms.first.nil? %>

When I use that syntax I get a routing error