Hi, I m trying to create a navigation menu as the one at the top of digg website... My navigation menu is composed of Menu, and Submenu... menu and submenu are form query to the DB... So right now, in my application layout, i ve put my Menu items ... I would like when i click on it, that the submenu show below the menu.... but my problem is that right now to do that i m using an action to perform the the submenu show... The big problem with this solution is that when i navigate to an other action, the submenu disapear... :(.. and i would like it to stay until i open an other menu.... So i guess that i should n t use an action to make the sub menu appear... how would you to that ? (i don t want to use ajax) Thanks a lot, Guillaume. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Diggs menus are not from a database (so it seems). As large as the menu/submenu set is, it points to distinct interest areas. Given that assumption, You''d do well to follow their lead : menu system is static to defined ''areas'', dynamic content is provided in lists on content_for_layout. Anyone happen to know the "actual" technology behind digg menus? -- Peter Fitzgibbons ------------------------------ iPhone -- "IT"-ness. hrefhttp://www.macdailynews.com/index.php/weblog/comments/apples_iphone_could_become_iconic_it_object ------------------------------ On 7/11/07, Differenthink <guillaume.montard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi, > > I m trying to create a navigation menu as the one at the top of digg > website... > My navigation menu is composed of Menu, and Submenu... menu and > submenu are form query to the DB... > > So right now, in my application layout, i ve put my Menu items ... > I would like when i click on it, that the submenu show below the > menu.... but my problem is that right now to do that i m using an > action to perform the the submenu show... > > The big problem with this solution is that when i navigate to an other > action, the submenu disapear... :(.. > and i would like it to stay until i open an other menu.... > > So i guess that i should n t use an action to make the sub menu > appear... how would you to that ? > (i don t want to use ajax) > > Thanks a lot, > > Guillaume. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
i said digg menu because it s how i want mine, in the sense of menu and submenu... My problem is that i m not able to show submenu without using an action, and using an action cause the problem that when i call an other action, the submenu disapear... :/ Is there a way to bypass that problem ? On Jul 11, 7:26 pm, "Peter Fitzgibbons" <peter.fitzgibb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Diggs menus are not from a database (so it seems). > As large as the menu/submenu set is, it points to distinct interest areas. > > Given that assumption, You''d do well to follow their lead : menu system is > static to defined ''areas'', dynamic content is provided in lists on > content_for_layout. > > Anyone happen to know the "actual" technology behind digg menus? > > -- > Peter Fitzgibbons > ------------------------------ > iPhone -- "IT"-ness. > href=http://www.macdailynews.com/index.php/weblog/comments/apples_iphone_c... > ------------------------------ > > On 7/11/07, Differenthink <guillaume.mont...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, > > > I m trying to create a navigation menu as the one at the top of digg > > website... > > My navigation menu is composed of Menu, and Submenu... menu and > > submenu are form query to the DB... > > > So right now, in my application layout, i ve put my Menu items ... > > I would like when i click on it, that the submenu show below the > > menu.... but my problem is that right now to do that i m using an > > action to perform the the submenu show... > > > The big problem with this solution is that when i navigate to an other > > action, the submenu disapear... :(.. > > and i would like it to stay until i open an other menu.... > > > So i guess that i should n t use an action to make the sub menu > > appear... how would you to that ? > > (i don t want to use ajax) > > > Thanks a lot, > > > Guillaume.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
did my sample not help you? as i said, there is no action required specifically for menu display. it works, for the most part, the way digg does http://www.digg.com/view/technology http://www.digg.com/hardware the first url above lists the stories that fall under the main topic of technology the second url lists the stories that fall under the topic technology, subtopic hardware in my example to you http://www.diggclone.com/topics/technology http://www.diggclone.com/topics/technology/hardware these would do the same thing as the digg versions. so the routes for my example are such map.main_topic /stories/:main_topic, :controller => ''story'', :action => ''topic'' map.sub_topic /stories/:main_topic/:sub_topic, :controller => ''story'', :action => ''topic'' the topic action of the story controller would be used to lookup all the stories of the particular topic and subtopic using params[:main_topic] and params[:sub_topic] On 7/11/07, Differenthink <guillaume.montard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > i said digg menu because it s how i want mine, in the sense of menu > and submenu... > My problem is that i m not able to show submenu without using an > action, and using an action cause the problem that when i call an > other action, the submenu disapear... :/ > > Is there a way to bypass that problem ? > > On Jul 11, 7:26 pm, "Peter Fitzgibbons" <peter.fitzgibb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > Diggs menus are not from a database (so it seems). > > As large as the menu/submenu set is, it points to distinct interest areas. > > > > Given that assumption, You''d do well to follow their lead : menu system is > > static to defined ''areas'', dynamic content is provided in lists on > > content_for_layout. > > > > Anyone happen to know the "actual" technology behind digg menus? > > > > -- > > Peter Fitzgibbons > > ------------------------------ > > iPhone -- "IT"-ness. > > href=http://www.macdailynews.com/index.php/weblog/comments/apples_iphone_c... > > ------------------------------ > > > > On 7/11/07, Differenthink <guillaume.mont...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Hi, > > > > > I m trying to create a navigation menu as the one at the top of digg > > > website... > > > My navigation menu is composed of Menu, and Submenu... menu and > > > submenu are form query to the DB... > > > > > So right now, in my application layout, i ve put my Menu items ... > > > I would like when i click on it, that the submenu show below the > > > menu.... but my problem is that right now to do that i m using an > > > action to perform the the submenu show... > > > > > The big problem with this solution is that when i navigate to an other > > > action, the submenu disapear... :(.. > > > and i would like it to stay until i open an other menu.... > > > > > So i guess that i should n t use an action to make the sub menu > > > appear... how would you to that ? > > > (i don t want to use ajax) > > > > > Thanks a lot, > > > > > Guillaume. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Good way, Chris. I wasn''t thinking routes when I first answered. Tell us how it goes, Guillaume. Peter Fitzgibbons ------------------------------ iPhone -- "IT"-ness. hrefhttp://www.macdailynews.com/index.php/weblog/comments/apples_iphone_could_become_iconic_it_object ------------------------------ On 7/11/07, Chris Hall <christopher.k.hall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > did my sample not help you? as i said, there is no action required > specifically for menu display. it works, for the most part, the way > digg does > > http://www.digg.com/view/technology > > http://www.digg.com/hardware > > the first url above lists the stories that fall under the main topic > of technology > > the second url lists the stories that fall under the topic technology, > subtopic hardware > > in my example to you > > http://www.diggclone.com/topics/technology > > http://www.diggclone.com/topics/technology/hardware > > these would do the same thing as the digg versions. > > so the routes for my example are such > > map.main_topic /stories/:main_topic, :controller => ''story'', :action => > ''topic'' > > map.sub_topic /stories/:main_topic/:sub_topic, :controller => ''story'', > :action => ''topic'' > > the topic action of the story controller would be used to lookup all > the stories of the particular topic and subtopic using > params[:main_topic] and params[:sub_topic] > > > > On 7/11/07, Differenthink <guillaume.montard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > i said digg menu because it s how i want mine, in the sense of menu > > and submenu... > > My problem is that i m not able to show submenu without using an > > action, and using an action cause the problem that when i call an > > other action, the submenu disapear... :/ > > > > Is there a way to bypass that problem ? > > > > On Jul 11, 7:26 pm, "Peter Fitzgibbons" <peter.fitzgibb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > Diggs menus are not from a database (so it seems). > > > As large as the menu/submenu set is, it points to distinct interest > areas. > > > > > > Given that assumption, You''d do well to follow their lead : menu > system is > > > static to defined ''areas'', dynamic content is provided in lists on > > > content_for_layout. > > > > > > Anyone happen to know the "actual" technology behind digg menus? > > > > > > -- > > > Peter Fitzgibbons > > > ------------------------------ > > > iPhone -- "IT"-ness. > > > href> http://www.macdailynews.com/index.php/weblog/comments/apples_iphone_c... > > > ------------------------------ > > > > > > On 7/11/07, Differenthink <guillaume.mont...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > Hi, > > > > > > > I m trying to create a navigation menu as the one at the top of digg > > > > website... > > > > My navigation menu is composed of Menu, and Submenu... menu and > > > > submenu are form query to the DB... > > > > > > > So right now, in my application layout, i ve put my Menu items ... > > > > I would like when i click on it, that the submenu show below the > > > > menu.... but my problem is that right now to do that i m using an > > > > action to perform the the submenu show... > > > > > > > The big problem with this solution is that when i navigate to an > other > > > > action, the submenu disapear... :(.. > > > > and i would like it to stay until i open an other menu.... > > > > > > > So i guess that i should n t use an action to make the sub menu > > > > appear... how would you to that ? > > > > (i don t want to use ajax) > > > > > > > Thanks a lot, > > > > > > > Guillaume. > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Well kind of hard to understand for me, but i will, i ll keep you posted... Anyway i would like to know if there is a simple answer to this question : "My problem is that i m not able to show submenu without using an action, and using an action cause the problem that when i call an other action, the submenu disapear... :/ Is there a way to bypass that problem ? " On Jul 12, 1:26 am, "Chris Hall" <christopher.k.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> did my sample not help you? as i said, there is no action required > specifically formenudisplay. it works, for the most part, the way > digg does > > http://www.digg.com/view/technology > > http://www.digg.com/hardware > > the first url above lists the stories that fall under the main topic > of technology > > the second url lists the stories that fall under the topic technology, > subtopic hardware > > in my example to you > > http://www.diggclone.com/topics/technology > > http://www.diggclone.com/topics/technology/hardware > > these would do the same thing as the digg versions. > > so the routes for my example are such > > map.main_topic /stories/:main_topic, :controller => ''story'', :action => ''topic'' > > map.sub_topic /stories/:main_topic/:sub_topic, :controller => ''story'', > :action => ''topic'' > > the topic action of the story controller would be used to lookup all > the stories of the particular topic and subtopic using > params[:main_topic] and params[:sub_topic] > > On 7/11/07, Differenthink <guillaume.mont...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > i said diggmenubecause it s how i want mine, in the sense ofmenu > > and submenu... > > My problem is that i m not able to show submenu without using an > > action, and using an action cause the problem that when i call an > > other action, the submenu disapear... :/ > > > Is there a way to bypass that problem ? > > > On Jul 11, 7:26 pm, "Peter Fitzgibbons" <peter.fitzgibb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > Diggs menus are not from a database (so it seems). > > > As large as themenu/submenu set is, it points to distinct interest areas. > > > > Given that assumption, You''d do well to follow their lead :menusystem is > > > static to defined ''areas'', dynamic content is provided in lists on > > > content_for_layout. > > > > Anyone happen to know the "actual" technology behind digg menus? > > > > -- > > > Peter Fitzgibbons > > > ------------------------------ > > > iPhone -- "IT"-ness. > > > href=http://www.macdailynews.com/index.php/weblog/comments/apples_iphone_c... > > > ------------------------------ > > > > On 7/11/07, Differenthink <guillaume.mont...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, > > > > > I m trying to create a navigationmenuas the one at the top of digg > > > > website... > > > > My navigationmenuis composed ofMenu, and Submenu...menuand > > > > submenu are form query to the DB... > > > > > So right now, in my application layout, i ve put myMenuitems ... > > > > I would like when i click on it, that the submenu show below the > > > >menu.... but my problem is that right now to do that i m using an > > > > action to perform the the submenu show... > > > > > The big problem with this solution is that when i navigate to an other > > > > action, the submenu disapear... :(.. > > > > and i would like it to stay until i open an othermenu.... > > > > > So i guess that i should n t use an action to make the submenu > > > > appear... how would you to that ? > > > > (i don t want to use ajax) > > > > > Thanks a lot, > > > > > Guillaume.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, I think what you are asking is how can you keep the correct level of menus displayed after re-rendering a page following an action. My approach to this, (and if there are other possibilities I would welcome them) is to hold the current command/menu level in the session, and then have application helpers that build the buttons based on that session info. The helper can then be called from the layout, so that you don''t have to think about menu levels for each action. You only need to change the session menu setting when a menu selection needs to change the sub menu. I hope that makes sense or perhaps I am being too simplistic for what you require. tonypm> "My problem is that i m not able to show submenu without using an > action, and using an action cause the problem that when i call an > other action, the submenu disapear... :/ > Is there a way to bypass that problem ? " > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Well it seems very clear and very helpful... your understood my problem !!!! I think i ve an idea of how to do it, it s just the part where i should call the helper from the layout, i would like to know how to call an helper form a layout ? (i''ve never used helper via layout).. Thanks a lot for everything.. Guillaume. On Jul 14, 10:53 am, tonypm <tonypmar...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> Hi, > > I think what you are asking is how can you keep the correct level of > menus displayed after re-rendering a page following an action. My > approach to this, (and if there are other possibilities I would > welcome them) is to hold the current command/menulevel in the > session, and then have application helpers that build the buttons > based on that session info. The helper can then be called from the > layout, so that you don''t have to think aboutmenulevels for each > action. You only need to change the sessionmenusetting when amenu > selection needs to change the submenu. > > I hope that makes sense or perhaps I am being too simplistic for what > you require. > > tonypm > > > "My problem is that i m not able to show submenu without using an > > action, and using an action cause the problem that when i call an > > other action, the submenu disapear... :/ > > Is there a way to bypass that problem ? "--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ok, The helper builds a string with the menu tags and then this is jincluded into the layout like any other tag helper. Here is some of my code (I like to use the += to concat strings, but others may comment that it is not the best way0 In application_helper.rb def customer_buttons x="<ul id=''menuButtons''>\n <li>" x+=link_to("Data File", {:action=>''get_amazon_orders_file'', :controller=>''amazon_orders''} ) x+="</li>\n <li>" x+=link_to("Import Customers", {:action=>''import_customers'', :controller=>''amazon_orders''} ) x+="</li>\n <li>" x+=link_to("List", {:action=>''list'',:controller=>''customers''} ) x+="</li>\n</ul>" return x end def context_buttons(command) if session[''user''] # application buttons only once logged in case command when ''admin'' admin_buttons when ''customer'' customer_buttons end end end In the layout: <%= context_buttons(session[:command])%> The only other part is to store the command into the session in the appropriate actions. I do this from actions called from a set of main buttons that select the main command areas. hth Tonypm On Jul 15, 10:27 pm, Differenthink <guillaume.mont...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Well it seems very clear and very helpful... your understood my > problem !!!! > I think i ve an idea of how to do it, it s just the part where i > should call the helper from the layout, > i would like to know how to call an helper form a layout ? > > (i''ve never used helper via layout).. > > Thanks a lot for everything.. > > Guillaume. > > On Jul 14, 10:53 am, tonypm <tonypmar...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > Hi, > > > I think what you are asking is how can you keep the correct level of > > menus displayed after re-rendering a page following an action. My > > approach to this, (and if there are other possibilities I would > > welcome them) is to hold the current command/menulevel in the > > session, and then have application helpers that build the buttons > > based on that session info. The helper can then be called from the > > layout, so that you don''t have to think aboutmenulevels for each > > action. You only need to change the sessionmenusetting when amenu > > selection needs to change the submenu. > > > I hope that makes sense or perhaps I am being too simplistic for what > > you require. > > > tonypm > > > > "My problem is that i m not able to show submenu without using an > > > action, and using an action cause the problem that when i call an > > > other action, the submenu disapear... :/ > >> Is there a way to bypass that problem ? "--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---