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
If you deploy via Passenger, use the RackBaseURI
directive: http://www.modrails.com/documentation/Users%20guide%20Apache.html#RackBaseURI
Otherwise, you can wrap the run
statement in your config.ru
with the following block:
map ActionController::Base.config.relative_url_root || "/" do
run FooApp::Application
end
Then you only have to set the environment variable RAILS_RELATIVE_URL_ROOT
to "/foo-app". This will even apply to routes set in gems or plugins.
Warning: do not mix these two solutions.