aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorZENATI YASSINE <zenati@informatique.univ-paris-diderot.fr>2014-04-16 21:49:39 +0200
committerZENATI YASSINE <zenati@informatique.univ-paris-diderot.fr>2014-04-16 21:49:39 +0200
commit129205157b231e90ad8612630daeca9214d424d8 (patch)
treee2a5042634e794c0efce9a47be1a23a1b0fb26cf /actionview/lib
parent4d566eec7837a2dbfa4072efc9d73333cd61c797 (diff)
downloadrails-129205157b231e90ad8612630daeca9214d424d8.tar.gz
rails-129205157b231e90ad8612630daeca9214d424d8.tar.bz2
rails-129205157b231e90ad8612630daeca9214d424d8.zip
[ci skip] Added examples for telephone_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 135173a339..206e11f0a5 100644
--- a/actionview/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/form_tag_helper.rb
@@ -592,6 +592,19 @@ module ActionView
#
# ==== Options
# * Accepts the same options as text_field_tag.
+ #
+ # ==== Examples
+ # telephone_field_tag 'name'
+ # # => <input id="name" name="name" type="tel" />
+ #
+ # telephone_field_tag 'tel', '0123456789'
+ # # => <input id="tel" name="tel" type="tel" value="0123456789" />
+ #
+ # telephone_field_tag 'tel', nil, class: 'special_input'
+ # # => <input class="special_input" id="tel" name="tel" type="tel" />
+ #
+ # telephone_field_tag 'tel', '0123456789', class: 'special_input', disabled: true
+ # # => <input disabled="disabled" class="special_input" id="tel" name="tel" type="tel" value="0123456789" />
def telephone_field_tag(name, value = nil, options = {})
text_field_tag(name, value, options.stringify_keys.update("type" => "tel"))
end