Reputation: 1435
I have this link
<%= link_to "contact", ecrire_message_path %>
That page contains:
$(document).on('turbolinks:load', function(){
// some correct javascript here
});
The javascript doesn't work when I click on the link. It only works after page reloads.
turbolink gem is installed and included.
I don't know how to add to the link_to
element not to use turbolinks.
Thanks
Upvotes: 1
Views: 797
Reputation: 15248
You can use
<%= link_to "contact", ecrire_message_path, data: { turbolinks: false } %>
If you want to disable Turbolinks for certain links, add a
data-turbolinks="false"
attribute to the tag:<a href="..." data-turbolinks="false">No turbolinks here</a>
Upvotes: 3