diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2013-01-08 07:39:06 -0800 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2013-01-08 07:39:06 -0800 |
commit | ac86cbec82acee18a5066e00b98d1c20fc677a15 (patch) | |
tree | 25110d7bb27562bfd4b2994a01950faed764c9a7 /actionpack/lib | |
parent | cc1c3c5be061e7572018f734e5239750ab449e3f (diff) | |
parent | 0f8f75c81a805b9e6721ee1a05b1f92263e62ff9 (diff) | |
download | rails-ac86cbec82acee18a5066e00b98d1c20fc677a15.tar.gz rails-ac86cbec82acee18a5066e00b98d1c20fc677a15.tar.bz2 rails-ac86cbec82acee18a5066e00b98d1c20fc677a15.zip |
Merge pull request #8810 from NARKOZ/image-submit-tag
set 'alt' attribute for image_submit_tag
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_tag_helper.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 479739bebd..5745286464 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -526,19 +526,19 @@ module ActionView # # ==== Examples # image_submit_tag("login.png") - # # => <input src="/images/login.png" type="image" /> + # # => <input alt="Login" src="/images/login.png" type="image" /> # # image_submit_tag("purchase.png", disabled: true) - # # => <input disabled="disabled" src="/images/purchase.png" type="image" /> + # # => <input alt="Purchase" disabled="disabled" src="/images/purchase.png" type="image" /> # - # image_submit_tag("search.png", class: 'search_button') - # # => <input class="search_button" src="/images/search.png" type="image" /> + # image_submit_tag("search.png", class: 'search_button', alt: 'Find') + # # => <input alt="Find" class="search_button" src="/images/search.png" type="image" /> # # image_submit_tag("agree.png", disabled: true, class: "agree_disagree_button") - # # => <input class="agree_disagree_button" disabled="disabled" src="/images/agree.png" type="image" /> + # # => <input alt="Agree" class="agree_disagree_button" disabled="disabled" src="/images/agree.png" type="image" /> # # image_submit_tag("save.png", data: { confirm: "Are you sure?" }) - # # => <input src="/images/save.png" data-confirm="Are you sure?" type="image" /> + # # => <input alt="Save" src="/images/save.png" data-confirm="Are you sure?" type="image" /> def image_submit_tag(source, options = {}) options = options.stringify_keys @@ -550,7 +550,7 @@ module ActionView options["data-confirm"] = confirm end - tag :input, { "type" => "image", "src" => path_to_image(source) }.update(options) + tag :input, { "alt" => image_alt(source), "type" => "image", "src" => path_to_image(source) }.update(options) end # Creates a field set for grouping HTML form elements. |