Highlight JS with Turbolinks
The Turbolinks gem doesn't let you use the $(document).ready() calls that highlight_js requires to highlight your code. Instead include the following at the bottom of your application.js:
$(document).on('page:change', function() {
$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
});
$(document).on('page:restore', function() {
$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
});
This runs the text highlighting when the page is changed or restored using Turbolinks.
Source:
http://kingori.co/minutae/2014/02/highlightjs-on-turbolinks/