Rails 5 - turbolinks 5,some JS not loaded on page render

前端 未结 7 1057

I have a Rails app, I recently updated to 5.0.0.RC1. Most of the transition went smooth, but I\'m having some trouble with the new Turbolinks. In my app I for e

7条回答
  •  孤城傲影
    2020-12-30 09:02

    I got a serious headache to find a way to make all my javascript work. First i try the solution with the gem jquery.turbolinks by following this video: How to upgrade to turbolinks 5 but i got lightbox for showing the images in the same page not working properly. So before just disable Turbolinks once and for all, i take more time on the github page and i try this:

    
    

    You need to put that on each link where the javascript need a page reload to work.

    Maybe its not the best solution, but that make my headache less painful.

提交回复
热议问题