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

Popular posts from this blog

php - Hide output during test execution -

javascript - Migrate custom AngularJS filter from 1.2.28 to 1.4.x -

Update Magento products with multiple images -