Hey. So I have a Rails app that's getting deployed to a production machine that serves it via Apache/Passenger to two subURIs.
/app
/app_2
both the above subURIs are running the same codebase. It's just two symlinks to the public dir that are both pointed to via Passenger by:
RailsBaseURI "/app"
RailsBaseURI "/app_2"
Now, imma big fan of jQuery. So I'm using it with a couple of plugins and one of them is an autocomplete function:
$("#municipality_name").autocomplete('autocomplete_municipality', {
matchContains: true,
scroll: false
}).result(function(event, data, formatted) {
$.post('fill_state', {city: formatted}, null, 'script');
});
The problem I'm having is when this gets run in production, the url that gets called is
http://www.app.com/autocomplete_municipality
rather than
http://www.app.com/app/autocomplete_municipality
- or -
http://www.app.com/app_2/autocomplete_municipality
(I know it's lacking the controller name in there, I have routes to give me these paths.)
Anyways, my question is, how the hell do I tell jQuery to not blow away the subURI path? config.action_controller.relative_url_root = "/signup_2"
doesn't seem a viable option because I have multiple subURIs here. I am also loath to change the path in the jQuery method to be autocomplete('app/autocomplete_municipality'...
since I still don't get access to my two subURIs. Maybe this is the only option.
The reason for the two URIs is mostly for internal testing --> production switchover (as we open the new site first to the company internally, then to the public at large) and we wanted to be able to launch everything at once from /app_2 (our testing path) to /app (the public path) without having to change anything on the configuration side.
Thoughts?