Improve documentation of local_assigns

This commit is contained in:
Rafael Mendonça França 2015-02-18 17:40:58 -02:00
parent e07eb079bf
commit 02b955766e

@ -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.
#