aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_tag_helper.rb
diff options
context:
space:
mode:
authorAlex Soulim <soulim@gmail.com>2012-04-03 16:01:00 +0400
committerAlex Soulim <soulim@gmail.com>2012-05-18 08:38:19 +0400
commit446940c366d588e7e895a64caf325f5f99cba0fb (patch)
tree413b070e34022ddf4a8889b0045dd4582a8a65bc /actionpack/lib/action_view/helpers/form_tag_helper.rb
parentb23ac936a6ef980547666da002681a77d8340573 (diff)
downloadrails-446940c366d588e7e895a64caf325f5f99cba0fb.tar.gz
rails-446940c366d588e7e895a64caf325f5f99cba0fb.tar.bz2
rails-446940c366d588e7e895a64caf325f5f99cba0fb.zip
Add HTML5 input[type="time"] helper
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_tag_helper.rb11
1 files changed, 11 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 9e5c66f4a9..e65b4e3e95 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -549,6 +549,17 @@ module ActionView
text_field_tag(name, value, options.stringify_keys.update("type" => "date"))
end
+ # Creates a text field of type "time".
+ #
+ # === Options
+ # * <tt>:min</tt> - The minimum acceptable value.
+ # * <tt>:max</tt> - The maximum acceptable value.
+ # * <tt>:step</tt> - The acceptable value granularity.
+ # * Otherwise accepts the same options as text_field_tag.
+ def time_field_tag(name, value = nil, options = {})
+ text_field_tag(name, value, options.stringify_keys.update("type" => "time"))
+ end
+
# Creates a text field of type "url".
#
# ==== Options