I followed the instructions in this answer: Rails, javascript not loading after clicking through link_to helper. Everything works perfectly for my local host, but my Heroku app encounters the same problem for whatever reason. I am using rails 4 and ruby 1.9.3, not sure why my particular app isnt loading the javascript.
I want to clarify that when refreshing the page and loading it initially the javascript works perfectly on my Heroku app. The specific problem is that when i click through to a page with javascript (that worked previously) with a link_to it fails to load.
Does anyone have any ideas? My issue is identical to the link I posted but I couldnt figure out how to get the fix to work on Heroku. The code I used in my fix is below:
jQuery ->
ready = ->
$('#products').dataTable
sPaginationType: "full_numbers"
bJQueryUI: true
bProcessing: true
bServerSide: true
sAjaxSource: $('#products').data('source')
$(document).ready ready
$(document).on "page:load", ready