You need to initialize scripts via turbolinks. Check this ASCIIcast about turbolinks.
In general, you need to change...
jQuery(function() {
# your script
});
...to...
var ready;
ready = function() {
# your script
};
$(document).ready(ready);
$(document).on('page:load', ready);
All turbo links events you can find here.
Update for Turbolinks 5
page:load
has changed to turbolinks:load
, so instead you want to write:
var ready;
ready = function() {
# your script
};
$(document).on('turbolinks:load', ready);
You no longer need to specify $(document).ready();
as turbolinks:load
does that. For more info, check out the README.