From b27376773e8f51b03bd4cb2678764cd392455870 Mon Sep 17 00:00:00 2001 From: Eaden McKee Date: Fri, 12 Mar 2010 14:13:10 +1300 Subject: simplify alt tag generation for images [#2837 state:committed] Signed-off-by: Jeremy Kemper --- actionpack/lib/action_view/helpers/asset_tag_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index de3d61ebbe..0c488b6793 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -11,7 +11,7 @@ module ActionView # the assets exist before linking to them: # # image_tag("rails.png") - # # => Rails src= + # # => Rails # stylesheet_link_tag("application") # # => # @@ -523,7 +523,7 @@ module ActionView options.symbolize_keys! src = options[:src] = path_to_image(source) - options[:alt] ||= File.basename(src, '.*').split('.').first.to_s.capitalize + options[:alt] ||= File.basename(src, '.*').capitalize if size = options.delete(:size) options[:width], options[:height] = size.split("x") if size =~ %r{^\d+x\d+$} -- cgit v1.2.3