By dynamic menus, I assume you mean you want a navbar or something in
the layout to change based on the context of a user''s session. So, you
may have different tools associated with each page, right?
Assuming we''re on the right track, I''d explore using the flash
system
for something like that. So, you could set your flash[:navbar] to
something in your application controller, and then override it where
you would like to have it work differently in other controllers.
Also, I found this helpful in Scott Raymond''s Ajax on Rails book. He
puts a simple method in his application_helper.rb:
def flash_div *keys
divs = keys.select { |k| flash[k] }.collect do |k|
content_tag :div, flash[k], :class => "flash #{k}"
end
divs.join
end
Cheers,
On Apr 28, 10:04 pm, Rm Rm
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hi,
>
> I need to generate dynamic menus and those menus items need to be picked
> from the database based on the role of the person logged in. Has anybody
> done anything similar to it? Any help and guidance is greatly
> appreciated.
>
> Thanks.
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---