aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_tag_helper.rb
diff options
context:
space:
mode:
authorCarlos Galdino <carloshsgaldino@gmail.com>2012-05-16 19:20:32 -0300
committerCarlos Galdino <carloshsgaldino@gmail.com>2012-05-21 17:23:48 -0300
commit1ce4b5b33d694eeebdb0495aef70d8d1b50cd02d (patch)
tree0676fe1ca8520a02cb3e97bc279a74c84ff155ef /actionpack/lib/action_view/helpers/form_tag_helper.rb
parent513a0525c24c2944630acfa465b22cd2f4601adf (diff)
downloadrails-1ce4b5b33d694eeebdb0495aef70d8d1b50cd02d.tar.gz
rails-1ce4b5b33d694eeebdb0495aef70d8d1b50cd02d.tar.bz2
rails-1ce4b5b33d694eeebdb0495aef70d8d1b50cd02d.zip
Add HTML5 input[type="color"] helper
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_tag_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb
index e65b4e3e95..7da67cd2f9 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -524,6 +524,14 @@ module ActionView
output.safe_concat("</fieldset>")
end
+ # Creates a text field of type "color".
+ #
+ # ==== Options
+ # * Accepts the same options as text_field_tag.
+ def color_field_tag(name, value = nil, options = {})
+ text_field_tag(name, value, options.stringify_keys.update("type" => "color"))
+ end
+
# Creates a text field of type "search".
#
# ==== Options