【发布时间】:2011-03-02 00:07:40
【问题描述】:
我想使用链接触发模型的远程操作。基本上这个链接需要做的就是用一个参数触发一个方法。
这是我的代码:
= link_to 'Move Up', reorder_collection_folder_path(@collection, folder), :reorder => :up, :remote => true
这确实会按预期触发 Folders#reorder 控制器操作,但不会传递 :reorder 参数。我的日志说:
Started GET "/collections/1/folders/1/reorder" for 127.0.0.1 at 2011-03-01 18:03:31 -0600
Processing by FoldersController#reorder as JS
Parameters: {"collection_id"=>"1", "id"=>"1"}
那么,如何通过远程链接传递参数?我在这里做错了什么?
【问题讨论】:
标签: ruby-on-rails ajax ruby-on-rails-3 parameters controller