Fixes issue with navigation failing after page reload

removed onload function form app.js, added functions to onload function in application.html.erb