I have a Rails 4 application that uses Turbolinks. I understand that TurbolinksjQuery code breaks because Turbolinks does not load a new page, but only receives new elements.
Consequently, going to a new page may not cause .ready, although it always calls .page:load, and therefore, the new jQuery code will not be initialized.
I have a lot of jQuery code, so I don’t want to change jQuery code to be compatible with Turbolinks.
Is it possible to add javascript code to my application.js that overwrites the event .readyto be included page:load? How should I do it?
source
share