Edit: I found the issue to my answer here:
Rails 4: how to use $(document).ready() with turbo-links
As the title says, I have some JQuery at the bottom of the application.js
file inside my Rails 5 app. I've noticed it won't fire if I'm traveling from page to page. It will however, work if I just reload the page I'm on.
Just to be perfectly clear, this is my application.js
file:
#app/assets/javascripts/application.js
... Rest of file.
//= require_tree .
$( document ).ready(function() {
alert('test');
});
I won't get an alert at all if I'm just clicking page to page within my app. Again, the alert
will only fire if I reload the page I'm currently on.
Any help with this would be wonderful.