我想使按钮与自定义远程操作 当我尝试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