2010-07-18 77 views
2

这可能是因为button_to_remote函数似乎被定义为Prototype helper?我用jQuery驱动替换了我的/public/javascripts/rails.jsbutton_to_remote使用jQuery和Rails 3

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

如果使用button_to_remote,我怎么能做到使用jQuery + Rails的3

回答

4

试试这个同样的事情是不可能的:

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

谢谢。你如何指定响应动作的控制器? – 2010-10-24 14:36:35

+0

代码段已更新... – Rob 2010-10-25 12:53:58

+0

我将此标记为答案,但我没有对其进行测试;) – 2012-01-05 21:06:19