Skip to content

Commit

Permalink
[ci skip] Added examples for url_field_tag method
Browse files Browse the repository at this point in the history
  • Loading branch information
ZENATI YASSINE committed Apr 16, 2014
1 parent 1292051 commit c0c646f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions actionview/lib/action_view/helpers/form_tag_helper.rb
Expand Up @@ -677,6 +677,19 @@ def week_field_tag(name, value = nil, options = {})
#
# ==== 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
Expand Down

0 comments on commit c0c646f

Please sign in to comment.