Ruby on Rails:link_to_remote javascript坏了吗?

时间:2010-07-08 17:14:55

标签: ruby-on-rails

我有这个

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

我已经尝试过:before,:after,:loading,:complete ...它们似乎都没有工作......我知道按钮有效,导致表格进入下一页。

1 个答案:

答案 0 :(得分:0)

看起来您的参数被包装它们的哈希错误地拆分了。

你的:在将JS片段/回调传递给html_options参数哈希之后,而不是选项哈希(将在何处使用)。

更改为以下内容:

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