Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 619411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:39:08+00:00 2026-05-13T18:39:08+00:00

Hey. So I have a Rails app that’s getting deployed to a production machine

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:39:09+00:00Added an answer on May 13, 2026 at 6:39 pm

    Or you could use a named route and a view helper to define the url in a JavaScript var.

    var autocomplete_path = <%= autocomplete_municipality_path %>;
    

    Yeah, that’s ugly.

    (deploying your testing and production apps to separate domains (or subdomains) instead of separate dirs will eliminate these problems)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys I have a ruby on rails app with a before filter setup
The main idea is that I have several worker instances of a Rails app,
Hey guys another rails issue, Currently have a collection that is line items for
Hey i have this div that shows as a popup: <div class=popup> </div> Then
Hey all - I have an app where I'm authenticating the user. They pass
Hey. I have an object that has a string property called BackgroundColor. This string
Hey, all. Working on my first Rails app. I've searched all around - read
Hey all, I've got a client that is integrating a Rails 1.2.6 site with
Hey I have a really simple question that needs more of just an explanation
Hey i have a div moving via a jquery animation and i am trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.