diff options
author | ZENATI YASSINE <zenati@informatique.univ-paris-diderot.fr> | 2014-04-19 18:05:18 +0200 |
---|---|---|
committer | ZENATI YASSINE <zenati@informatique.univ-paris-diderot.fr> | 2014-04-19 18:05:18 +0200 |
commit | fb955f1eaf6b1fdbb321ec55f40f4a4806d62fd8 (patch) | |
tree | 5474623a14c8567e60e47e9161a758183de29ac8 /actionview | |
parent | c2fa85f48124fe69a420139360d1369016296e62 (diff) | |
download | rails-fb955f1eaf6b1fdbb321ec55f40f4a4806d62fd8.tar.gz rails-fb955f1eaf6b1fdbb321ec55f40f4a4806d62fd8.tar.bz2 rails-fb955f1eaf6b1fdbb321ec55f40f4a4806d62fd8.zip |
[ci skip] Added example for email_field_tag method
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/helpers/form_tag_helper.rb | 13 |
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 66c9e20682..47d4c04b09 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -698,6 +698,19 @@ module ActionView # # ==== Options # * Accepts the same options as text_field_tag. + # + # ==== Examples + # email_field_tag 'name' + # # => <input id="name" name="name" type="email" /> + # + # email_field_tag 'email', 'email@example.com' + # # => <input id="email" name="email" type="email" value="email@example.com" /> + # + # email_field_tag 'email', nil, class: 'special_input' + # # => <input class="special_input" id="email" name="email" type="email" /> + # + # email_field_tag 'email', 'email@example.com', class: 'special_input', disabled: true + # # => <input disabled="disabled" class="special_input" id="email" name="email" type="email" value="email@example.com" /> def email_field_tag(name, value = nil, options = {}) text_field_tag(name, value, options.stringify_keys.update("type" => "email")) end |