instance method
view_assigns
Ruby on Rails 4.2.9
Since v3.0.20Signature
view_assigns()
This method should return a hash with assigns. You can overwrite this configuration per controller. :api: public
Source
# File actionpack/lib/abstract_controller/rendering.rb, line 66
def view_assigns
protected_vars = _protected_ivars
variables = instance_variables
variables.reject! { |s| protected_vars.include? s }
variables.each_with_object({}) { |name, hash|
hash[name.slice(1, name.length)] = instance_variable_get(name)
}
end
Defined in actionpack/lib/abstract_controller/rendering.rb line 66
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in AbstractController::Rendering