提交 afc1c62b 编写于 作者: C claudiob

Docs: `tag` only accept attribute names as symbols

[ci skip]

See https://github.com/rails/rails/issues/26518#issuecomment-252826489

@dhh:
> I'd support symbol-only keys going forward with these new APIs.
> We can break with the past here since the tag proxy is new and so is form_with.
上级 32617a2c
......@@ -139,6 +139,7 @@ def method_missing(called, *args, &block)
# ==== Options
#
# Any passed options become attributes on the generated tag.
# You can only use symbols (not strings) for the attribute names.
#
# tag.section class: %w( kitties puppies )
# # => <section class="kitties puppies"></section>
......@@ -200,7 +201,7 @@ def method_missing(called, *args, &block)
# hash to +options+. Set +escape+ to false to disable attribute value
# escaping.
#
# ==== Options
# ==== Options (Legacy syntax)
#
# You can use symbols or strings for the attribute names.
#
......@@ -210,7 +211,7 @@ def method_missing(called, *args, &block)
# HTML5 <tt>data-*</tt> attributes can be set with a single +data+ key
# pointing to a hash of sub-attributes.
#
# ==== Examples
# ==== Examples (Legacy syntax)
#
# tag("br")
# # => <br />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册