From 06dd7b8efa3073f413cf7a6b57c6a1a90a242ae1 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 26 Feb 2006 00:55:22 +0000 Subject: The image_tag helper is not converting the options hash to symbols (closes #3615) [agkr@pobox.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/asset_tag_helper.rb | 2 +- actionpack/test/template/asset_tag_helper_test.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 418092cf88..0b725ce508 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -131,7 +131,7 @@ module ActionView # * file name, like "rss.gif", that gets expanded to "/images/rss.gif" # * file name without extension, like "logo", that gets expanded to "/images/logo.png" def image_tag(source, options = {}) - options.symbolize_keys + options.symbolize_keys! options[:src] = image_path(source) options[:alt] ||= File.basename(options[:src], '.*').split('.').first.capitalize diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb index 8ec3229547..5e2d46cbf8 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -74,6 +74,7 @@ class AssetTagHelperTest < Test::Unit::TestCase %(image_tag("xml")) => %(Xml), %(image_tag("rss", :alt => "rss syndication")) => %(rss syndication), %(image_tag("gold", :size => "45x70")) => %(Gold), + %(image_tag("symbolize", "size" => "45x70")) => %(Symbolize) } def test_auto_discovery @@ -174,6 +175,7 @@ class AssetTagHelperNonVhostTest < Test::Unit::TestCase %(image_tag("rss", :alt => "rss syndication")) => %(rss syndication), %(image_tag("gold", :size => "45x70")) => %(Gold), %(image_tag("http://www.example.com/images/icon.gif")) => %(Icon), + %(image_tag("symbolize", "size" => "45x70")) => %(Symbolize) } def test_auto_discovery -- cgit v1.2.3