我希望通过一个链接来触发模型的远程操作,这个链接只需要触发一个带有一个参数的方法。
下面是我的代码:
= 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"}
那么,我如何通过远程链接传递参数?我在这里做错了什么?