提交 fb955f1e 编写于 作者: Z ZENATI YASSINE

[ci skip] Added example for email_field_tag method

上级 c2fa85f4
......@@ -698,6 +698,19 @@ def url_field_tag(name, value = nil, options = {})
#
# ==== Options
# * Accepts the same options as text_field_tag.
#
# ==== Examples
# email_field_tag 'name'
# # => <input id="name" name="name" type="email" />
#
# email_field_tag 'email', 'email@example.com'
# # => <input id="email" name="email" type="email" value="email@example.com" />
#
# email_field_tag 'email', nil, class: 'special_input'
# # => <input class="special_input" id="email" name="email" type="email" />
#
# email_field_tag 'email', 'email@example.com', class: 'special_input', disabled: true
# # => <input disabled="disabled" class="special_input" id="email" name="email" type="email" value="email@example.com" />
def email_field_tag(name, value = nil, options = {})
text_field_tag(name, value, options.stringify_keys.update("type" => "email"))
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册