Ruby on Rails:link_to_remote javascript坏了?

Ruby on Rails:link_to_remote javascript坏了?

问题描述:

我有这个Ruby on Rails:link_to_remote javascript坏了?

<%= link_to_remote "Next", 
    {:url => { :controller=>:objects, 
     :action=>:filter_recent, 
     :page=>@objects.next_page}, 
     :with => "Form.serialize('filter')" }, 
    :after => "alert('hello')"%> 

我已经试过:前:后装载,:完成...没有人似乎工作...我知道了按钮的作品,导致表的进步到下一页。

它看起来像你的论点是由你包裹其中的哈希不正确分裂

您:JS片断/回调被传递到html_options参数散列之后,而不是选项哈希(哪里会用过的)。

更改为以下:

<%= link_to_remote "Next", 
    :url => { 
     :controller=>:objects, 
     :action=>:filter_recent, 
     :page=>@objects.next_page 
    }, 
    :with => "Form.serialize('filter')", 
    :after => "alert('hello')"%> 
+0

你,先生,是我最好的朋友。 (但是只有在我进行所有这些更改时的接下来的5分钟内)= p – NullVoxPopuli 2010-07-08 19:53:42