当rails发送不了post请求,加上在application.js中加上 jquery_ujs
使用 link_to 发送post请求时 ,老是发 get请求。
这时候 只需要在 application.js中加入 //= require jquery_ujs 即可。
jquery_ujs 是能够识别 data-method data-confirm 等等一个东东。
<a data-method="post" href="/artists/collect_artwork?id=1" rel="nofollow">收藏</a>