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 934777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:03:14+00:00 2026-05-15T21:03:14+00:00

I am porting a 2.x rails app to rails3; we’ll call it foo-app. Foo-app

  • 0

I am porting a 2.x rails app to rails3; we’ll call it foo-app. Foo-app is one section of a larger rails app and lives at main_rails_app.com/foo-app. Previously we just set up the following in our foo-app production config to ensure that our foo-app routes worked properly:

ActionController::Base.relative_url_root = "/foo-app"

However, with rails3, I now get:

DEPRECATION WARNING: ActionController::Base.relative_url_root is ineffective. Please stop using it.

I have since changed the config entry to the following:

config.action_controller.relative_url_root = "/foo-app"

This mostly works in that all calls to external resources (javascript/css/images) will use /foo-app. However, none of my routes change appropriately, or put another way, foo-app root_path gives me ‘/’ when I would expect ‘/foo-app’.

Two questions:

  1. What is the replacement for ActionController::Base.relative_url_root
  2. if it is config.action_controller.relative_url_root, then why are my routes not reflecting the relative_url_root value I set?
  • 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-15T21:03:15+00:00Added an answer on May 15, 2026 at 9:03 pm

    You should be able to handle all that within the routes.rb file. Wrap all your current routes in scope; for instance.

    scope "/context_root" do
       resources :controller
       resources :another_controller
       match 'welcome/', :to => "welcome#index"
       root :to => "welcome#index"
    end
    

    You can then verify your routing via the rake routes they should show your routes accordingly, including your context root(relative_url_root)

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

Sidebar

Related Questions

I'm porting a rails app to grails that uses oauth to push messages to
I am porting a Rails 2.3.8 app to Rails 3.0.0Beta4. I can't get the
I recently inherited an e-commerce app (Java/Struts) that I'm porting to Rails. The thing
I have an app that I'm porting from PHP/symfony to Ruby/Rails. Though the language
I'm wondering if porting a Rails app from Apache2 + Passenger to Nginx +
Im porting a project from php to java. The project is a web-app based
I'm currently in the process of writing my first Rails app. I'm writing a
Im porting an old silverlight 3 app that used WS* webservices to connect. These
I'm building a rails app that interacts with a 3rd party API When a
So I'm working on a large rails app that has a bunch of selenium

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.