diff options
author | ZENATI YASSINE <zenati@informatique.univ-paris-diderot.fr> | 2014-04-16 21:53:20 +0200 |
---|---|---|
committer | ZENATI YASSINE <zenati@informatique.univ-paris-diderot.fr> | 2014-04-16 21:53:20 +0200 |
commit | c0c646f45fbb716d066e909153d445f63e9dfc3a (patch) | |
tree | 42886671a2f1764441e843cbdfaec83438cd5920 /actionview/lib/action_view | |
parent | 129205157b231e90ad8612630daeca9214d424d8 (diff) | |
download | rails-c0c646f45fbb716d066e909153d445f63e9dfc3a.tar.gz rails-c0c646f45fbb716d066e909153d445f63e9dfc3a.tar.bz2 rails-c0c646f45fbb716d066e909153d445f63e9dfc3a.zip |
[ci skip] Added examples for url_field_tag method
Diffstat (limited to 'actionview/lib/action_view')
-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 206e11f0a5..b4a841b946 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -677,6 +677,19 @@ module ActionView # # ==== Options # * Accepts the same options as text_field_tag. + # + # ==== Examples + # url_field_tag 'name' + # # => <input id="name" name="name" type="url" /> + # + # url_field_tag 'url', 'http://rubyonrails.org' + # # => <input id="url" name="url" type="url" value="http://rubyonrails.org" /> + # + # url_field_tag 'url', nil, class: 'special_input' + # # => <input class="special_input" id="url" name="url" type="url" /> + # + # url_field_tag 'url', 'http://rubyonrails.org', class: 'special_input', disabled: true + # # => <input disabled="disabled" class="special_input" id="url" name="url" type="url" value="http://rubyonrails.org" /> def url_field_tag(name, value = nil, options = {}) text_field_tag(name, value, options.stringify_keys.update("type" => "url")) end |