Rails 4 Turbolinks make form submit multiple times

后端 未结 3 841
迷失自我
迷失自我 2020-12-10 08:03

I use some code working nicely on Rails 3 but not on Rails 4, I guess it is caused by Turbolinks but I don\'t know much about it, can\'t dig more deep to solve my problem, h

3条回答
  •  不思量自难忘°
    2020-12-10 08:58

    One possible reason you could be running into issues is if you are including the js on every page. It's my understanding it will append the js to the head and if you have included it on multiple pages you could find yourself binding the ajax multiple times. That being said it's not apparent how you are including the js from what I saw. You could possibly solve this by only including the js file in your application.js

提交回复
热议问题