views:

165

answers:

1

Hi,

I'm a newbie spanish Rails developer. ¿Can u help me with a problem with Rails?

I have an application with RoR 2 and Google maps and i catch X and Y coord to send to a controller. I use :with parameter

<%= link_to_remote "Obtener datos catastrales", :update => :catastro,:url => {:controller => "instalacions", :action => "catastro_ajax" }, :with=>"'coordx='+$('instalacion_longitud').value+'&coordy='+$('instalacion_latitud').value" %>

In the method :with i pass values from input text using prototype, but in Rails 3 the instruction link_to haven't :with method and i don´t know how to pass values from input text to a controller.

How can i migrate this instruction to Rails 3? I only need know how to capture the input text values to send to the controller.

Thanks!!

PS: Sorry for my english!!!!

A: 

You'll need to stop using obtrusive javascript. To get a grasp of the concept and how to implement it, take a look at this railscast: http://railscasts.com/episodes/205-unobtrusive-javascript

marcgg