I am hosting a sample application to clearly elaborate by problem. Try to visit the site, then follow another page link, using browser back return to previous page then to another page using browser forward button(You can continue move back and forth) "Hope you see what i am talking about"
Code: Previous page
<h1>Form page</h1>
<div id="rating-form">
<label for="rating-form"> Rating </label>
</div>
Loading my js code using
$(document).ready(function(){});
doesn't work until full page load( as i espect). So i followed this solution
$(document).on('turbolinks:load', function() {
$('#rating-form').raty({
path: '/assets/',
scoreName: 'review[rating]',
score: function(){
return 0
},
});
});
resulted to the bug in sample application
Using gem 'jquery-turbolinks' from this solution doest work with turbolinks 5
So how can i handle this problem ?