As you're using Turbolinks, the page instance does not change when you navigate from a page to another. I guess as a result, each time the page:change
event is fired you bind a new handler/closure using $('body').on
. As the previous handlers remain bound to the DOM, multiple instances of your closure are executed.
You may try to unbind the event before applying it again, or use a variable in the appropriate closure scope to ensure the handler is only applied once.
bound = false
jQuery(document).on "ready page:change", ->
unless bound
$('body').on 'click', '[data-behaviour="submit-on-check"]', ->
$(@).closest('form').submit()
bound = true