Closed valterbarros closed 6 years ago
Thank you @valterbarros! I don't have a project to test this with, but I can attempt a fix. I noticed that you added location.reload()
in the code for Turbolinks 5, can you explain that change?
I've opened #421 with your fix, can you test it please?
Hi, thanks for the help and my problem with js actually seems to be a problem with turbolinks itself and this issue https://github.com/turbolinks/turbolinks/issues/277 solved it. location.reload()
is no more necessary.
I test #421 here and the code is ok
Rails: 5.2.0 Turbolinks: 5.1.1 Ruby: 2.5.1
When a enter in a error from better errors and click in back button from browser something like this happen:
"rails-ujs has already been loaded!"
but other happen too likeselect2 is not defined
And I noticed that in your code you need update the turbolinks implementation for the new api
Turbolinks no longer uses
page:restore
now all events are withturbolinks
prefix liketurbolinks:load
To solve this I try in console from web put a reload in before the
removeEventListener
and addedturbolinks:load
inteadpage:restore
like: