diff options
| -rw-r--r-- | actionpack/Rakefile | 4 | ||||
| -rw-r--r-- | actionpack/lib/action_controller/abstract/renderer.rb | 4 | ||||
| -rw-r--r-- | actionpack/lib/action_controller/new_base/compatibility.rb | 13 | 
3 files changed, 19 insertions, 2 deletions
| diff --git a/actionpack/Rakefile b/actionpack/Rakefile index 9ce897aae8..d10e8b94a7 100644 --- a/actionpack/Rakefile +++ b/actionpack/Rakefile @@ -66,7 +66,6 @@ Rake::TestTask.new(:test_new_base_on_old_tests) do |t|    # * filters    # * integration    # * test -  # * view_paths    t.test_files = %w(      action_pack_assertions addresses_render assert_select      base benchmark caching capture content_type cookie dispatcher @@ -74,7 +73,8 @@ Rake::TestTask.new(:test_new_base_on_old_tests) do |t|      http_digest_authentication layout logging mime_responds      record_identifier redirect render render_js render_json      render_other render_xml request_forgery_protection rescue -    resources routing selector send_file url_rewriter verification webservice +    resources routing selector send_file url_rewriter +    verification view_paths webservice    ).map { |name| "test/controller/#{name}_test.rb" }    t.verbose = true  end 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 | 
