aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/asset_tag_helper.rb
diff options
context:
space:
mode:
authorEaden McKee <eadz@eadz.co.nz>2010-03-12 14:13:10 +1300
committerJeremy Kemper <jeremy@bitsweat.net>2010-03-11 17:33:41 -0800
commitb27376773e8f51b03bd4cb2678764cd392455870 (patch)
treebf63c86daebc5218693d37eb3c816fa47562edc6 /actionpack/lib/action_view/helpers/asset_tag_helper.rb
parentd56e8be22d50e439b75f13d8b581e24177cd76b7 (diff)
downloadrails-b27376773e8f51b03bd4cb2678764cd392455870.tar.gz
rails-b27376773e8f51b03bd4cb2678764cd392455870.tar.bz2
rails-b27376773e8f51b03bd4cb2678764cd392455870.zip
simplify alt tag generation for images
[#2837 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/lib/action_view/helpers/asset_tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb4
1 files changed, 2 insertions, 2 deletions
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")
- # # => <img alt="Rails src="/images/rails.png?1230601161" />
+ # # => <img alt="Rails" src="/images/rails.png?1230601161" />
# stylesheet_link_tag("application")
# # => <link href="/stylesheets/application.css?1232285206" media="screen" rel="stylesheet" type="text/css" />
#
@@ -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+$}