jimjohnlists-/E1597aS9LQAvxtiuMwx3w@public.gmane.org
2007-Mar-06 04:15 UTC
Help with link_to_function and creating pull down menu
Hi. I''m trying to create a pull down menu, but I''m not sure how to do it using the link_to_function in my view. When the user clicks on the select01.gif, the submenu on the side should display, else if should be hidden. Any help please. Thank you. <%= link_to_function( image_tag("graphics/ select01.gif", :alt=>''Programming'', :size=>''100x20'', :border=>0), :update => "select01_div", :url =>{ :action => :select01_action }) %> <div id="select01_div"> <%= image_tag ''graphics/ select01.gif'', :alt=>''Programming'', :size=>''100x20'' %> </div> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jorge Mario G. Mazo
2007-Mar-06 05:52 UTC
Re: Help with link_to_function and creating pull down menu
hi there you could use link_to_remote(link_to) and there :onclick => remote_funcion() to change the div you want I hope it helps On 3/5/07, jimjohnlists-/E1597aS9LQAvxtiuMwx3w@public.gmane.org <jimjohnlists-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> > Hi. I''m trying to create a pull down menu, but I''m not sure how to do > it using the link_to_function in my view. When the user clicks on the > select01.gif, the submenu on the side should display, else if should > be hidden. Any help please. Thank you. > > <%= link_to_function( image_tag("graphics/ > select01.gif", :alt=>''Programming'', :size=>''100x20'', :border=>0), > :update => "select01_div", > :url =>{ :action => :select01_action }) %> > > <div id="select01_div"> > <%= image_tag ''graphics/ > select01.gif'', :alt=>''Programming'', :size=>''100x20'' %> > </div> > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jimjohnlists-/E1597aS9LQAvxtiuMwx3w@public.gmane.org
2007-Mar-06 06:06 UTC
Re: Help with link_to_function and creating pull down menu
Thanks. I also got this from the Internet, but I wonder if you or anybody knows how I can get the value of an element after setting it. The following will close a divider, but I want it to toggle so that if the user clicks on the "Close" again, the menu will reappear. To do that, I need to get the page[div].??? state of the divider somehow. In the helper, I have module VideosHelper def hide_and_reset(div) update_page do |page| page[div].hide end end end Then in the view, I have <tr><td align="center"> <%= link_to_function "Close", hide_and_reset(:select02_div) %> <div id="select02_div"> <h4>test</h4> </div> </td></tr> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---