From 09907d1b933d202333280fb2efc079f8bf969e16 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Tue, 26 May 2009 12:14:50 -0700 Subject: Get controller/view_paths_test.rb to pass on new base --- actionpack/lib/action_controller/abstract/renderer.rb | 4 ++++ actionpack/lib/action_controller/new_base/compatibility.rb | 13 +++++++++++++ 2 files changed, 17 insertions(+) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/abstract/renderer.rb b/actionpack/lib/action_controller/abstract/renderer.rb index d7c68549e1..7f7ec78054 100644 --- a/actionpack/lib/action_controller/abstract/renderer.rb +++ b/actionpack/lib/action_controller/abstract/renderer.rb @@ -86,6 +86,10 @@ module AbstractController self.view_paths << path end + def prepend_view_path(path) + self.view_paths.unshift(path) + end + def view_paths self._view_paths end diff --git a/actionpack/lib/action_controller/new_base/compatibility.rb b/actionpack/lib/action_controller/new_base/compatibility.rb index 646e69843e..fddfadcbf2 100644 --- a/actionpack/lib/action_controller/new_base/compatibility.rb +++ b/actionpack/lib/action_controller/new_base/compatibility.rb @@ -116,5 +116,18 @@ module ActionController def performed? response_body end + + # ==== Request only view path switching ==== + def append_view_path(path) + view_paths.push(*path) + end + + def prepend_view_path(path) + view_paths.unshift(*path) + end + + def view_paths + _action_view.view_paths + end end end -- cgit v1.2.3