From 0f8f75c81a805b9e6721ee1a05b1f92263e62ff9 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Tue, 8 Jan 2013 14:48:13 +0400 Subject: set 'alt' attribute for image_submit_tag --- actionpack/lib/action_view/helpers/form_tag_helper.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'actionpack/lib') 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") - # # => + # # => # # image_submit_tag("purchase.png", disabled: true) - # # => + # # => # - # image_submit_tag("search.png", class: 'search_button') - # # => + # image_submit_tag("search.png", class: 'search_button', alt: 'Find') + # # => # # image_submit_tag("agree.png", disabled: true, class: "agree_disagree_button") - # # => + # # => # # image_submit_tag("save.png", data: { confirm: "Are you sure?" }) - # # => + # # => 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. -- cgit v1.2.3