I'm still fumbling learning RoR, so I apologize in advance.
I've got working code, but I don't think that it's done properly so
help to make this more efficient and most of all, correct, would be so
In my users_helper.rb file
sub_nav_menu = 
user = User.find(session[:user])
for role in user.roles
for right in role.rights
sub_nav_menu << right.id
end # for right
end # for role
end # if
end # def
In my application_helper.rb file for the layout and display
html_out = '<table><tr><td>'
for right in rights
right_array = Right.find(:all, :conditions => ["id = ?", right])
for menu in right_array
html_out << link_to_unless_current (menu.name,
:controller => menu.controller, :action => menu.action)
end #for right in rights
html_out << '</td></tr></table>'
In my controllers (not including the user_controller)
There's got to be a better, more Ruby like way to do this.