instance method
locals_code
Ruby on Rails 5.2.8.1
Since v5.2.8.1 PrivateSignature
locals_code()
No documentation comment.
Source
# File actionview/lib/action_view/template.rb, line 327
def locals_code
# Only locals with valid variable names get set directly. Others will
# still be available in local_assigns.
locals = @locals - Module::RUBY_RESERVED_KEYWORDS
locals = locals.grep(/\A@?(?![A-Z0-9])(?:[[:alnum:]_]|[^\0-\177])+\z/)
# Assign for the same variable is to suppress unused variable warning
locals.each_with_object("".dup) { |key, code| code << "#{key} = local_assigns[:#{key}]; #{key} = #{key};" }
end
Defined in actionview/lib/action_view/template.rb line 327
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Template