rails/rails — Issue #4053: No uniform replacement for 'config.relative_url_root'
Author: NovapaX
Created: 2011-12-20 13:12:06+00:00
State: open

Supplying
config.action_controller.relative_url_root = "/subdir"
in environment.rb is not possible anymore (at least in rails 3.1.3)

But what is the 'official' replacement to let your Rails app know it's running in a subdirectory and should prefix generated paths and urls with a subdirectory name.

Problem is that ENV['RAILS_RELATIVE_URL_ROOT'] is not honored in the url-helpers or path-helpers like: url_for() and path_for()
The asset pipeline and asset urls still make use of this environment variable.

I think supplying the relative root for deployment in a subdirectory should be done via environment variables, because it is installation/server specific.I believe
I believe wrapping all your routes in a namespace is not a viable solution. (I'm not hard-coding my domain-name either)