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

  • SEARCH
  • Home
  • 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 3991410
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:36:45+00:00 2026-05-20T06:36:45+00:00

This is a weird one I know. I’m trying to tie together two Rails

  • 0

This is a weird one I know. I’m trying to tie together two Rails applications, a v3 and a v2.3.5

I want them to share the same domain, and in order to do that without changing the URLs in the older app, I’m trying to find a way to override the Rails router.

I want the newer app living at the root of the domain, and the older one under several directories. For example:

/          => app1 # v3
/users     => app1
/employees => app2 # v2.3.5
/payrolls  => app2

So, since app1 lives at root and I’m using Passenger, I only have to create symlinks in the public folder of app1 to the public folder of app2, like so:

app1/public/employees => app2/public
app1/public/payrolls  => app2/public

And then I add RailsBaseURI /employees and RailsBaseURI /payrolls to Apache’s config.

With that I can make old URLs of app2 work, but inside the app, the links point to a prefix. For example, /employees/1, /employees/employees/1, /payrolls/employees/1 all work, but links in the app point to /employees/employees/1 and /payrolls/employees/1 depending on which prefix I’m currently on.

So, I need to remove that prefix from the links so only the old URLs work.

I need to do this in order to release the newer app. In time I’ll upgrade the older one to v3 and work directly on this issue, but right now any hack is ok just to make it work.

I don’t expect a solution, but if you can point me in the right direction on where to look in Rails source, or maybe a simpler approach I’m not seeing, I’d be very grateful.

  • 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-20T06:36:46+00:00Added an answer on May 20, 2026 at 6:36 am

    Turns out it’s pretty easy just by overriding url_for in the ApplicationHelper like so:

    def url_for(options = {})
      original = super(options)
      # I tried this in order to improve performance:
      return original unless original.starts_with?('/employees/employees')
      original.gsub('/employees/employees', '/employees')
    end
    

    However, this caused intermittent errors in the app that I wasn’t able to pinpoint. I suppose it’s because of the performance hit.

    So in the end I was forced to use a different domain for the newer apps.

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

Sidebar

Related Questions

Ok, this is a weird one. The junk data isn't random either, it appears
This is a bit of a weird one, and I could well be coding
This one is weird, I have a page that consists of a html table
Now this is a weird one We have a project where we are reading
Bit of a weird one this. I'm rendering datasets on a map and need
I dunno guys, this is a really weird one, but I might just be
I have this weird situation. I have these two classes: Public Class Entry End
I've seen this weird behavior on several sites recently: I scroll down a page
I've got this weird problem - I'm calling ChangeServiceConfig on a newly installed service
I'm experiencing this weird problem which my scrollbar jumps by itself to somewhere that

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.