diff options
author | Łukasz Strzałkowski <lukasz.strzalkowski@gmail.com> | 2013-07-05 14:34:39 +0200 |
---|---|---|
committer | Łukasz Strzałkowski <lukasz.strzalkowski@gmail.com> | 2013-08-25 11:39:09 +0200 |
commit | 8e3413d41098eca3806ef0bed978d71397e3b1da (patch) | |
tree | ec17d7ab63a600faf509a7e00456d4540e7df38d /actionview/lib | |
parent | c90971644a90372cfa56dac8b9b2ce709a6e7267 (diff) | |
download | rails-8e3413d41098eca3806ef0bed978d71397e3b1da.tar.gz rails-8e3413d41098eca3806ef0bed978d71397e3b1da.tar.bz2 rails-8e3413d41098eca3806ef0bed978d71397e3b1da.zip |
Create AbstractController::Rendering interface
This interface should be use when implementing renderers.
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/rendering.rb | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/actionview/lib/action_view/rendering.rb b/actionview/lib/action_view/rendering.rb index 9bade857be..6453b0543a 100644 --- a/actionview/lib/action_view/rendering.rb +++ b/actionview/lib/action_view/rendering.rb @@ -83,21 +83,11 @@ module ActionView # Normalize arguments, options and then delegates render_to_body and # sticks the result in self.response_body. def render(*args, &block) + super options = _normalize_render(*args, &block) self.response_body = render_to_body(options) end - # Raw rendering of a template to a string. - # - # It is similar to render, except that it does not - # set the response_body and it should be guaranteed - # to always return a string. - # - # If a component extends the semantics of response_body - # (as Action Controller extends it to be anything that - # responds to the method each), this method needs to be - # overridden in order to still return a string. - # :api: plugin def render_to_string(*args, &block) options = _normalize_render(*args, &block) render_to_body(options) @@ -126,7 +116,7 @@ module ActionView # You can overwrite this configuration per controller. # :api: public def view_assigns - hash = {} + hash = super variables = instance_variables variables -= protected_instance_variables variables -= DEFAULT_PROTECTED_INSTANCE_VARIABLES @@ -148,6 +138,7 @@ module ActionView # render "foo/bar" to render :file => "foo/bar". # :api: plugin def _normalize_args(action=nil, options={}) + options = super(action, options) case action when NilClass when Hash @@ -166,6 +157,7 @@ module ActionView # Normalize options. # :api: plugin def _normalize_options(options) + options = super(options) if options[:partial] == true options[:partial] = action_name end @@ -177,10 +169,5 @@ module ActionView options[:template] ||= (options[:action] || action_name).to_s options end - - # Process extra options. - # :api: plugin - def _process_options(options) - end end end |