aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorZENATI YASSINE <zenati@informatique.univ-paris-diderot.fr>2014-04-19 18:09:07 +0200
committerZENATI YASSINE <zenati@informatique.univ-paris-diderot.fr>2014-04-19 18:09:07 +0200
commit320d436141e197e1c254563f77feff00610d15cf (patch)
tree3259ded7a6f47ed9399e773e41b625ae405bc788 /actionview/lib
parentfb955f1eaf6b1fdbb321ec55f40f4a4806d62fd8 (diff)
downloadrails-320d436141e197e1c254563f77feff00610d15cf.tar.gz
rails-320d436141e197e1c254563f77feff00610d15cf.tar.bz2
rails-320d436141e197e1c254563f77feff00610d15cf.zip
[ci skip] Added example for date_field_tag method
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/helpers/form_tag_helper.rb13
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 47d4c04b09..3104d424dc 100644
--- a/actionview/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/form_tag_helper.rb
@@ -614,6 +614,19 @@ module ActionView
#
# ==== Options
# * Accepts the same options as text_field_tag.
+ #
+ # ==== Examples
+ # date_field_tag 'name'
+ # # => <input id="name" name="name" type="date" />
+ #
+ # date_field_tag 'date', '01/01/2014'
+ # # => <input id="date" name="date" type="date" value="01/01/2014" />
+ #
+ # date_field_tag 'date', nil, class: 'special_input'
+ # # => <input class="special_input" id="date" name="date" type="date" />
+ #
+ # date_field_tag 'date', '01/01/2014', class: 'special_input', disabled: true
+ # # => <input disabled="disabled" class="special_input" id="date" name="date" type="date" value="01/01/2014" />
def date_field_tag(name, value = nil, options = {})
text_field_tag(name, value, options.stringify_keys.update("type" => "date"))
end