diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-04-28 23:29:29 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-04-28 23:29:46 -0500 |
commit | c0a372ba87f556769b98a6d06e8c684c3c3156df (patch) | |
tree | ac64ad4c56383731ba822088ffe4a697e77ef4ac /actionpack/lib/action_controller/base | |
parent | 8925e89c6307b8b7c8aeb0277ae5e059904b2fc6 (diff) | |
download | rails-c0a372ba87f556769b98a6d06e8c684c3c3156df.tar.gz rails-c0a372ba87f556769b98a6d06e8c684c3c3156df.tar.bz2 rails-c0a372ba87f556769b98a6d06e8c684c3c3156df.zip |
Deprecate template, session, assigns, and layout accessors on response object. Instead access them through the controller instance. This mainly affects functional test assertions.
Diffstat (limited to 'actionpack/lib/action_controller/base')
-rw-r--r-- | actionpack/lib/action_controller/base/base.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/base/mime_responds.rb | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base/base.rb b/actionpack/lib/action_controller/base/base.rb index 2063df54b4..14c4339c94 100644 --- a/actionpack/lib/action_controller/base/base.rb +++ b/actionpack/lib/action_controller/base/base.rb @@ -367,6 +367,8 @@ module ActionController #:nodoc: # Returns the name of the action this controller is processing. attr_accessor :action_name + attr_reader :template + class << self def call(env) # HACK: For global rescue to have access to the original request and response @@ -816,7 +818,7 @@ module ActionController #:nodoc: def initialize_template_class(response) @template = response.template = ActionView::Base.new(self.class.view_paths, {}, self, formats) - response.template.helpers.send :include, self.class.master_helper_module + @template.helpers.send :include, self.class.master_helper_module response.redirected_to = nil @performed_render = @performed_redirect = false end diff --git a/actionpack/lib/action_controller/base/mime_responds.rb b/actionpack/lib/action_controller/base/mime_responds.rb index bac225ab2a..1003e61a0b 100644 --- a/actionpack/lib/action_controller/base/mime_responds.rb +++ b/actionpack/lib/action_controller/base/mime_responds.rb @@ -127,7 +127,7 @@ module ActionController #:nodoc: @order << mime_type @responses[mime_type] ||= Proc.new do - @response.template.formats = [mime_type.to_sym] + @controller.template.formats = [mime_type.to_sym] @response.content_type = mime_type.to_s block_given? ? block.call : @controller.send(:render, :action => @controller.action_name) end |