Go to urlpath in the hash for the data key. For instance:
$.ajax({ url: '/navigations/sidenav', data:{"urlpath":urlpath}, success: function(e){ $("#sideNav-container").slideDown("slow"); } });
Then, the urlpath in the params object will be passed, which you can access from your controller. Therefore you can just do
params[:urlpath]
and you can get the urlpath you went to. :)
source share