aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-07-24 14:06:22 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-24 14:06:22 -0500
commitf48b9ab5c2741ddbdbc0a9f4cd06875a1e3c8b02 (patch)
tree5341ba9bdb9b58cf144a21076945a6563327695b /actionpack/lib/action_controller/base.rb
parent11fdcf88c2aea72ec84c5d4ab05986f5d35a9a81 (diff)
downloadrails-f48b9ab5c2741ddbdbc0a9f4cd06875a1e3c8b02.tar.gz
rails-f48b9ab5c2741ddbdbc0a9f4cd06875a1e3c8b02.tar.bz2
rails-f48b9ab5c2741ddbdbc0a9f4cd06875a1e3c8b02.zip
ActionController::Base.relative_url_root falls back to ENV['RAILS_RELATIVE_URL_ROOT']
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-xactionpack/lib/action_controller/base.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index bae7e8c12e..5f4a38dac0 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -356,7 +356,12 @@ module ActionController #:nodoc:
# If you are deploying to a subdirectory, you will need to set
# <tt>config.action_controller.relative_url_root</tt>
- class_inheritable_accessor :relative_url_root
+ # This defaults to ENV['RAILS_RELATIVE_URL_ROOT']
+ cattr_writer :relative_url_root
+
+ def self.relative_url_root
+ @@relative_url_root || ENV['RAILS_RELATIVE_URL_ROOT']
+ end
# Holds the request object that's primarily used to get environment variables through access like
# <tt>request.env["REQUEST_URI"]</tt>.