GMaps4Rails and Turbolinks not loading without full page refresh

前端 未结 6 1689
悲哀的现实
悲哀的现实 2020-12-28 09:32

I\'m using gmaps4rails to load a map on a \"clients\" show page. I\'ve integrated turbolinks to make the app speadier all together, but now I\'m hitting an issue where I hav

6条回答
  •  一生所求
    2020-12-28 10:06

    The fix ended up that I need a full page load for the scripts to refresh.

    Adding

    'data-no-turbolink' => true
    

    to the link that goes to the maps page worked.

    For example, if I have an index page of clients, and I have a map of where the client lives on the show page, the link to go to the show page would be formatted as below:

    <%= link_to 'View Client', client, class: "btn", 'data-no-turbolink' => true %>
    

    This will cause a full refresh of the html and javascript, instead of just the changed html.

提交回复
热议问题