我想使按鈕與自定義遠程操作 當我嘗試Rail3 button_to遠程自定義操作
<%= button_to "something", {:controller => :updates, :action => :new}, {:remote => true} %>
它工作正常,但如果我改變:動作我自己定義的動作在控制器
<%= button_to "something", {:controller => :updates, :action => :destroy_all, :method => :delete}, {:remote => true} %>
窗體中生成的路徑是錯誤的
<form action="/assets?action=destroy_all&controller=updates&method=delete" class="button_to" data-remote="true" method="post">
在updates_controll呃我已經定義:destroy_all
def destroy_all
#some spaghetti code
end
我做了什麼錯了?
什麼是你的路由文件是什麼樣子? – Mischa