提交 708e1109 编写于 作者: S Sean Griffin

Merge pull request #17771 from agis-/issue-17373

Local vars should exist in partials for falsy `:object:` values too
* Local variable in a partial is now available even if a falsy value is
passed to `:object` when rendering a partial.
Fixes #17373.
*Agis Anastasopoulos*
* Add support for `:enforce_utf8` option in `form_for`.
This is the same option that was added in 06388b0 to `form_tag` and allows
......
......@@ -366,7 +366,7 @@ def setup(context, options, block)
partial = options[:partial]
if String === partial
@object = options[:object]
@object = options[:object] if options.has_key?(:object)
@collection = collection_from_options
@path = partial
else
......@@ -506,7 +506,7 @@ def merge_prefix_into_object_path(prefix, object_path)
def retrieve_template_keys
keys = @locals.keys
keys << @variable if @object || @collection
keys << @variable if defined?(@object) || @collection
if @collection
keys << @variable_counter
keys << @variable_iteration
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册