提交 320d4361 编写于 作者: Z ZENATI YASSINE

[ci skip] Added example for date_field_tag method

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