aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/caching/pages.rb4
-rw-r--r--actionpack/lib/action_controller/dispatcher.rb2
-rw-r--r--actionpack/lib/action_controller/rescue.rb2
3 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/caching/pages.rb b/actionpack/lib/action_controller/caching/pages.rb
index 4307f39583..755f1e4e0a 100644
--- a/actionpack/lib/action_controller/caching/pages.rb
+++ b/actionpack/lib/action_controller/caching/pages.rb
@@ -36,7 +36,7 @@ module ActionController #:nodoc:
# == Setting the cache directory
#
# The cache directory should be the document root for the web server and is set using Base.page_cache_directory = "/document/root".
- # For Rails, this directory has already been set to RAILS_ROOT + "/public".
+ # For Rails, this directory has already been set to Rails.public_path (which is usually set to RAILS_ROOT + "/public").
#
# == Setting the cache extension
#
@@ -46,7 +46,7 @@ module ActionController #:nodoc:
def self.included(base) #:nodoc:
base.extend(ClassMethods)
base.class_eval do
- @@page_cache_directory = defined?(RAILS_ROOT) ? "#{RAILS_ROOT}/public" : ""
+ @@page_cache_directory = defined?(Rails.public_path) ? Rails.public_path : ""
cattr_accessor :page_cache_directory
@@page_cache_extension = '.html'
diff --git a/actionpack/lib/action_controller/dispatcher.rb b/actionpack/lib/action_controller/dispatcher.rb
index 92576bdb2b..30db7d9f73 100644
--- a/actionpack/lib/action_controller/dispatcher.rb
+++ b/actionpack/lib/action_controller/dispatcher.rb
@@ -67,7 +67,7 @@ module ActionController
end
cattr_accessor :error_file_path
- self.error_file_path = "#{::RAILS_ROOT}/public" if defined? ::RAILS_ROOT
+ self.error_file_path = Rails.public_path if defined?(Rails.public_path)
cattr_accessor :unprepared
self.unprepared = true
diff --git a/actionpack/lib/action_controller/rescue.rb b/actionpack/lib/action_controller/rescue.rb
index b91115a93c..f5ad04532b 100644
--- a/actionpack/lib/action_controller/rescue.rb
+++ b/actionpack/lib/action_controller/rescue.rb
@@ -153,7 +153,7 @@ module ActionController #:nodoc:
# If the file doesn't exist, the body of the response will be left empty.
def render_optional_error_file(status_code)
status = interpret_status(status_code)
- path = "#{RAILS_ROOT}/public/#{status[0,3]}.html"
+ path = "#{Rails.public_path}/#{status[0,3]}.html"
if File.exist?(path)
render :file => path, :status => status
else