I am building a Rails (3.0.3) application with some JavaScript using jQuery (1.4.4). On one of the sites I added a click event listener and want to load some content using a AJAX request.
$(document).ready(function() {
$("a#settings").click(function() {
$("div#box").load("settings.js");
return false;
});
});
When I now open the site "http://localhost:3000/entities/3" where the link with the bound click listener is located and click the link I get a 404 error. This happens because the AJAX request uses the URL "http://localhost:3000/entities/settings.js" and not (as I would exect) "http://localhost:3000/entities/3/settings.js".