aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-xactionpack/lib/action_controller/base.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 62dba3bc43..3c855a9346 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -356,9 +356,9 @@ module ActionController #:nodoc:
# Deprecated. Use view_paths instead.
def template_root=(path)
- view_paths.unshift(path)
+ prepend_view_path path
+ template_root
end
- deprecate :template_root= => :view_paths
# Deprecated. Use view_paths instead.
def template_root
@@ -374,7 +374,7 @@ module ActionController #:nodoc:
def view_paths=(value)
@@view_paths[name] = value
end
-
+
# View load paths for controller.
def view_paths
if paths = @@view_paths[name]
@@ -388,6 +388,22 @@ module ActionController #:nodoc:
end
end
+ # Adds a view_path to the front of the view_paths array.
+ # If the current class has no view paths, copy them from
+ # the superclass
+ def prepend_view_path(path)
+ self.view_paths = view_paths.dup if view_paths.frozen?
+ view_paths.unshift(path)
+ end
+
+ # Adds a view_path to the end of the view_paths array.
+ # If the current class has no view paths, copy them from
+ # the superclass
+ def append_view_path(path)
+ self.view_paths = view_paths.dup if view_paths.frozen?
+ view_paths << path
+ end
+
# Replace sensitive paramater data from the request log.
# Filters paramaters that have any of the arguments as a substring.
# Looks in all subhashes of the param hash for keys to filter.