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

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -

Qt4: how to send QString inside a struct via QSharedMemory -