aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/rendering.rb
diff options
context:
space:
mode:
authorŁukasz Strzałkowski <lukasz.strzalkowski@gmail.com>2013-07-11 14:18:06 +0200
committerŁukasz Strzałkowski <lukasz.strzalkowski@gmail.com>2013-08-25 11:39:09 +0200
commit49608f7b81314fea0487311f57b41b721c375339 (patch)
tree498b540abbe6655ffccf3a117094672e18624148 /actionview/lib/action_view/rendering.rb
parent3419ac26e97e38c6356c29672f5054ad072c01af (diff)
downloadrails-49608f7b81314fea0487311f57b41b721c375339.tar.gz
rails-49608f7b81314fea0487311f57b41b721c375339.tar.bz2
rails-49608f7b81314fea0487311f57b41b721c375339.zip
Move protected_instance_variables & view_assigns to AbstractController
Diffstat (limited to 'actionview/lib/action_view/rendering.rb')
-rw-r--r--actionview/lib/action_view/rendering.rb19
1 files changed, 4 insertions, 15 deletions
diff --git a/actionview/lib/action_view/rendering.rb b/actionview/lib/action_view/rendering.rb
index 925ae14925..f4afb63d5f 100644
--- a/actionview/lib/action_view/rendering.rb
+++ b/actionview/lib/action_view/rendering.rb
@@ -23,11 +23,6 @@ module ActionView
extend ActiveSupport::Concern
include ActionView::ViewPaths
- included do
- class_attribute :protected_instance_variables
- self.protected_instance_variables = []
- end
-
# Overwrite process to setup I18n proxy.
def process(*) #:nodoc:
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
@@ -106,21 +101,15 @@ module ActionView
view_renderer.render(view_context, options)
end
- DEFAULT_PROTECTED_INSTANCE_VARIABLES = [
- :@_action_name, :@_response_body, :@_formats, :@_prefixes, :@_config,
- :@_view_context_class, :@_view_renderer, :@_lookup_context
- ]
+ def default_protected_instance_vars
+ super + [:@_view_context_class, :@_view_renderer, :@_lookup_context]
+ end
# This method should return a hash with assigns.
# You can overwrite this configuration per controller.
# :api: public
def view_assigns
- hash = super
- variables = instance_variables
- variables -= protected_instance_variables
- variables -= DEFAULT_PROTECTED_INSTANCE_VARIABLES
- variables.each { |name| hash[name[1..-1]] = instance_variable_get(name) }
- hash
+ super
end
private