Added steps outlined in this stack overflow post
http://stackoverflow.com/questions/17881384/jquery-gets-loaded-only-on-page-refresh-in-rails-4-application
this was to fix the issue with javascript not always working before a page refresh