diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-16 06:04:23 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-16 06:04:23 +0000 |
commit | 89e06ed4c6191aff7769aeea8842f45df85acf89 (patch) | |
tree | e13b82847a3bff17afa1e43a0ce04a7c0d1e7353 /actionpack/lib/action_view/helpers/asset_tag_helper.rb | |
parent | a32303e0fcc1dd43de1d1e51442b542deaca8bf5 (diff) | |
download | rails-89e06ed4c6191aff7769aeea8842f45df85acf89.tar.gz rails-89e06ed4c6191aff7769aeea8842f45df85acf89.tar.bz2 rails-89e06ed4c6191aff7769aeea8842f45df85acf89.zip |
Fixed image_tag so an exception is not thrown just because the image is missing and alt value can't be generated #1395 [Marcel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers/asset_tag_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_tag_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index de507c6ceb..32244166d2 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -95,7 +95,7 @@ module ActionView options.symbolize_keys options[:src] = image_path(source) - options[:alt] ||= source.split("/").last.split(".").first.capitalize + options[:alt] ||= File.basename(options[:src], '.*').split('.').first.capitalize if options[:size] options[:width], options[:height] = options[:size].split("x") |