I have a javascript file called "front.js" i load from "application.js" like usual with this code:
//= require front
Inside "front.js",i have many functions i want to launch when the document is ready like this:
$(document).ready(function() {
$("#test").click(function(event){
...
});
});
But the problem is "front.js" is loaded only when i refresh the page manually (ctrl+r / f5 ) and not when i move from page to page, so my javascript code cannot be executed as wanted. Maybe this comes from turbolinks, i dont know how to handle this issue. When i put scripts directly in the html files, it works but it's definitely not the right thing to do.
Can anyone help me on this please ?