I need to print out the path of any page for use in an ajax call inside a js.erb file. Not sure how to build the helper for this if one doesn’t already exist. Here’s what I’d like to do…
$.ajax({
url: "<%= path_to 'product.html' %>",
context: document.body
}).done(function(result) {
console.log( result );
});