Forum: Ruby on Rails Help with link_to_function and creating pull down menu

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
9fd462ec8e479e0530eab840221c14aa?d=identicon&s=25 (Guest)
on 2007-03-06 05:17
(Received via mailing list)
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' %>
4f7fb063aecdf8344774cd7238d8b585?d=identicon&s=25 Jorge Mario G. Mazo (Guest)
on 2007-03-06 06:53
(Received via mailing list)
hi there
you could use link_to_remote(link_to) and there :onclick =>
to change the div you want
I hope it helps
9fd462ec8e479e0530eab840221c14aa?d=identicon&s=25 (Guest)
on 2007-03-06 07:07
(Received via mailing list)
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|

Then in the view, I have

<tr><td align="center">
<%= link_to_function "Close", hide_and_reset(:select02_div) %>
<div id="select02_div">
This topic is locked and can not be replied to.