使这个实际异步发布的正确咒语是什么?
form_tag :controller => :magic, :action => :search, :method => post, :remote => true do
method=post 和 remote=true 只是在 url 的末尾被压扁,而不是真正使它成为一个 ajax post。
最佳答案
我发现唯一的方法是将 url 参数包装在 url_for 方法中。
form_tag url_for(:action => :create, :id => @artist.id), :remote => true do
但是,如果您需要传递 method
参数,您可能需要将其和远程包裹在括号中。
关于ruby-on-rails - 没有命名路线的rails3中的远程form_tag,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3507551/