提交 235e0d9c 编写于 作者: Z ZENATI YASSINE

[ci skip] Added examples for color_field_tag method

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