diff options
author | José Valim <jose.valim@gmail.com> | 2010-03-12 20:39:53 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-12 20:39:53 +0100 |
commit | f2c0a353aef41a6df2de8e1fe3eaa3d8bbd8a6dd (patch) | |
tree | a854e0b7b79968f7f7cdfb57d29fd6644805c5ae /actionpack/lib/abstract_controller/rendering.rb | |
parent | 2a12686832fbcf0566454904a5d733998506bf56 (diff) | |
download | rails-f2c0a353aef41a6df2de8e1fe3eaa3d8bbd8a6dd.tar.gz rails-f2c0a353aef41a6df2de8e1fe3eaa3d8bbd8a6dd.tar.bz2 rails-f2c0a353aef41a6df2de8e1fe3eaa3d8bbd8a6dd.zip |
Finish cleaning up rendering stack from views and move assigns evaluation to controller (so plugins and/or controllers can overwrite just one method).
Diffstat (limited to 'actionpack/lib/abstract_controller/rendering.rb')
-rw-r--r-- | actionpack/lib/abstract_controller/rendering.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 42f4939108..16664098e5 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -31,6 +31,8 @@ module AbstractController module Rendering extend ActiveSupport::Concern + + include AbstractController::Assigns include AbstractController::ViewPaths # Overwrite process to setup I18n proxy. @@ -54,8 +56,8 @@ module AbstractController @_view_context ||= ActionView::Base.for_controller(self) end - # Mostly abstracts the fact that calling render twice is a DoubleRenderError. - # Delegates render_to_body and sticks the result in self.response_body. + # Normalize arguments, options and then delegates render_to_body and + # sticks the result in self.response_body. def render(*args, &block) options = _normalize_args(*args, &block) _normalize_options(options) @@ -78,8 +80,10 @@ module AbstractController end # Find and renders a template based on the options given. - def _render_template(options) - view_context.render_template(options) { |template| _with_template_hook(template) } + # :api: private + def _render_template(options) #:nodoc: + _evaluate_assigns(view_context) + view_context.render(options) end # The prefix used in render "foo" shortcuts. @@ -134,9 +138,5 @@ module AbstractController def _process_options(options) end - - def _with_template_hook(template) - self.formats = template.formats - end end end |