Rails 3 中的 link_to_remote 和 link_to

发布于 2024-09-18 17:46:01 字数 491 浏览 3 评论 0原文

我是西班牙 Rails 开发新手。 ¿你能帮我解决 Rails 的问题吗?

我有一个带有 RoR 2 和 Google 地图的应用程序,我捕获 X 和 Y 坐标 发送到控制器。我在方法中使用 :with 参数

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

:with 我使用原型从输入文本传递值,但在 Rails 3 中,指令 link_to 没有 :with 方法,我不知道如何将输入文本中的值传递到控制器。

我如何将此指令迁移到 Rails 3?我只需要知道如何 捕获输入文本值以发送到控制器。

谢谢!!

PS:对不起我的英语!!!!

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

: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!!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

您需要停止使用干扰性的 JavaScript。要了解这个概念以及如何实现它,请查看这个railscast:http: //railscasts.com/episodes/205-unobtrusive-javascript

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文