DanC wrote:
> My app has a series of sidebar menus that are getting a bit long and
> I'd like to compact them into an optional dropdown. I know how to do a
> simple show/hide action, but I'd like to use cookies to store the user
> preferences so that same sidebars stay open/closed when they navigate
> around the site.
> 
> Does anybody know any good rails based tutorials that would help a
> JavaScript novice get started on this one.

I'm thinking you could simply store a bit-mask in the session where each 
bit represents the state of each menu item.

For example if you had 5 collapsible menus and the second and fourth 
menu were open then store 01010 = 10 in session[:menu_state] = 10. Pass 
session[:menu_state] to your JavaScript on each request and use that to 
control your menu.
-- 
Posted via http://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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to