Here is what I did to get it working using this link
I removed the turboprops and all this link
Then we added this to index.html.erb without using jQuery $(document).on('ready
if ($('#infinite-scrolling').size() > 0){ $(window).on('scroll', function(){ var more_posts_url = $('.pagination .next_page a').attr('href') heights = $(document).height() - $(window).height() - 500 if(more_posts_url && $(window).scrollTop() > heights){ $('.pagination').html('<img src="/assets/ajax-loader.gif" alt="Loading..." title="Loading..." />') $.getScript(more_posts_url) } }); }
Then all *.js.erb will start working.
I tried to avoid removing turbolinks, but tried to get it to work with it.
source share