I'm having some trouble loading my javascript when I use a link_to helper in rails. When I either manually enter the url with 'localhost:3000/products/new' or reload the page, the javascript loads, but when I go through a link as written below, the jQuery $(document).ready
will not load on the new page.
Link_to, javascript does not load when I click this link:
<%= link_to New Product, new_product_path %>
products.js file
$(document).ready(function() {
alert(test);
});
Any help would be much appreciated. Thanks in advance!