jquery - 使用 jQuery 和 Rails 3 的 button_to_remote

标签 jquery ajax ruby-on-rails-3 prototypejs

鉴于button_to_remote,这可能吗?函数似乎被定义为原型(prototype)助手?我已经更换了我的/public/javascripts/rails.js使用 jQuery 驱动程序。

当我尝试使用button_to_remote时我收到错误 undefined method 'button_to_remote' for #<#<Class:0x000001078d7090>:0x0000010789ad20>

如果这不可能使用 button_to_remote ,我如何使用 jQuery + Rails 3 完成同样的事情。

最佳答案

试试这个:

<%= button_to "Do Something", 
              { :controller => :somecontroller, :action=> :something }, 
              { :remote => true } 
 %>

关于jquery - 使用 jQuery 和 Rails 3 的 button_to_remote,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3277314/

相关文章:

ruby-on-rails - Heroku Rails 应用程序在 HTTP 请求时立即崩溃

mysql - Rails 3,mysql/mysql2 将一些检索到的字符串错误解释为 ASCII-8BIT

javascript - 如何使用 jquery 将 div 动画化为不同的方向并淡出

javascript - PHP 编程错误(无法运行 while 循环)

javascript - Safari 保存的密码覆盖表单中的自动完成 ="off"

javascript - .Click() 函数不工作 Jquery

javascript - 动态广告脚本替换页面

javascript - 在html页面上拖放后显示图像

c# - jquery ajax调用返回值

ruby-on-rails - 子域约束并排除某些子域