diff options
author | ZENATI YASSINE <zenati@informatique.univ-paris-diderot.fr> | 2014-04-16 21:15:01 +0200 |
---|---|---|
committer | ZENATI YASSINE <zenati@informatique.univ-paris-diderot.fr> | 2014-04-16 21:27:14 +0200 |
commit | 235e0d9c641462eb59989cc3d6ba7a2ccca43bdf (patch) | |
tree | f7af210e7e19381b79733e347bc251aff0110249 /actionview | |
parent | c1dc6470cbb2708b4bf1bf3bc0681e8f811341b2 (diff) | |
download | rails-235e0d9c641462eb59989cc3d6ba7a2ccca43bdf.tar.gz rails-235e0d9c641462eb59989cc3d6ba7a2ccca43bdf.tar.bz2 rails-235e0d9c641462eb59989cc3d6ba7a2ccca43bdf.zip |
[ci skip] Added examples for color_field_tag method
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/helpers/form_tag_helper.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index 0bbe08166b..d0ed7ae5eb 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -550,6 +550,19 @@ module ActionView # # ==== 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 |