diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 1e30593af1cf8..a60fe7c1c1b79 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -65,14 +65,12 @@ def rendered_format # You can overwrite this configuration per controller. # :api: public def view_assigns - hash = {} variables = instance_variables variables -= protected_instance_variables variables -= DEFAULT_PROTECTED_INSTANCE_VARIABLES - variables.each { |name| + variables.each_with_object({}) { |name, hash| hash[name.slice(1, name.length)] = instance_variable_get(name) } - hash end # Normalize args by converting render "foo" to render :action => "foo" and