Forum: Ruby on Rails Javascript + rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4184124738873c21d5435fd4ef60d7df?d=identicon&s=25 hpacheco (Guest)
on 2007-06-05 02:52
(Received via mailing list)
Hi,

I have the following code for a google map event:

@map.event_init(@map,:click,"function(overlay,point)
   {
     if (overlay)
     {
       map.removeOverlay(overlay);
       document.getElementById(\"latitude\").value=null;
       document.getElementById(\"longitude\").value=null;
     }
     else
     {
       map.addOverlay(new GMarker(point));
       document.getElementById(\"latitude\").value=point.y;
       document.getElementById(\"longitude\").value=point.x;
     }
   }")

As you can see, the action is written in JS.
How can I call a ruby action from that code, so I can handle events
properly?

Thanks,
hugo
This topic is locked and can not be replied to.