新手问题 link_to :delete 的请求为什么都变成 Get 了?

windxj · January 23, 2013 · Last by woaigithub replied at January 24, 2013 · 2924 hits

不知道改了什么,现在的所有 <%=link_to'xxx',method: :delete%>http delete 全变为了 get 。。。

你的 application.js 里面是不是没有

//= require jquery_ujs

#1 楼 @zlx_star 额,是的,被删了,懂了,请问那个 method delete 和这个的关系是?

@windxj 简单的说,就是浏览器只支持 get、post 请求不支持 delete 请求,需要 js 支持。

#3 楼 @neverlandxy_naix 哦哦,懂了!谢谢~

或者直接用 button_to

You need to Sign in before reply, if you don't have an account, please Sign up first.