aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_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_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_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 6510610034..c5a9057698 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -939,6 +939,15 @@ module ActionView
Tags::RadioButton.new(object_name, method, self, tag_value, options).render
end
+ # Returns a text_field of type "color".
+ #
+ # color_field("car", "color")
+ # # => <input id="car_color" name="car[color]" type="color" value="#000000" />
+ #
+ def color_field(object_name, method, options = {})
+ Tags::ColorField.new(object_name, method, self, options).render
+ end
+
# Returns an input of type "search" for accessing a specified attribute (identified by +method+) on an object
# assigned to the template (identified by +object_name+). Inputs of type "search" may be styled differently by
# some browsers.