diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 465022f714..2a4f8accaa 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -87,6 +87,19 @@ class Template # expected_encoding # ) + ## + # :method: local_assigns + # + # Returns a hash with the defined local variables. + # + # Given this sub template rendering: + # + # <%= render "shared/header", { headline: "Welcome", person: person } %> + # + # You can use +local_assigns+ in the sub templates to access the local variables: + # + # local_assigns[:headline] # => "Welcome" + eager_autoload do autoload :Error autoload :Handlers @@ -252,13 +265,6 @@ def compile!(view) #:nodoc: end end - ## - # :method: local_assigns - # - # Returns a hash with the defined local variables - # - # local_assigns[:full] # => true - # Among other things, this method is responsible for properly setting # the encoding of the compiled template. #