Prepend a word to all ajax urls by some configuration change in rails app -
i have rails app in have used ajax calls url. want append project name ajax urls. 1 way edit urls. there other simpler way same?
to prepend word (let project_name) ajax calls in application write following code in js file:
$.ajaxsetup({ beforesend: function(data, settings) { var url = "/project_name"+ settings.url; settings.url = url; } });
Comments
Post a Comment