Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
The image_tag helper is not converting the options hash to symbols (c…
…loses #3615) [agkr@pobox.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Feb 26, 2006
1 parent e57bd72 commit 06dd7b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/asset_tag_helper.rb
Expand Up @@ -131,7 +131,7 @@ def image_path(source)
# * 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
Expand Down
2 changes: 2 additions & 0 deletions actionpack/test/template/asset_tag_helper_test.rb
Expand Up @@ -74,6 +74,7 @@ def relative_url_root
%(image_tag("xml")) => %(<img alt="Xml" src="/images/xml.png" />),
%(image_tag("rss", :alt => "rss syndication")) => %(<img alt="rss syndication" src="/images/rss.png" />),
%(image_tag("gold", :size => "45x70")) => %(<img alt="Gold" height="70" src="/images/gold.png" width="45" />),
%(image_tag("symbolize", "size" => "45x70")) => %(<img alt="Symbolize" height="70" src="/images/symbolize.png" width="45" />)
}

def test_auto_discovery
Expand Down Expand Up @@ -174,6 +175,7 @@ def relative_url_root
%(image_tag("rss", :alt => "rss syndication")) => %(<img alt="rss syndication" src="/calloboration/hieraki/images/rss.png" />),
%(image_tag("gold", :size => "45x70")) => %(<img alt="Gold" height="70" src="/calloboration/hieraki/images/gold.png" width="45" />),
%(image_tag("http://www.example.com/images/icon.gif")) => %(<img alt="Icon" src="http://www.example.com/images/icon.gif" />),
%(image_tag("symbolize", "size" => "45x70")) => %(<img alt="Symbolize" height="70" src="/calloboration/hieraki/images/symbolize.png" width="45" />)
}

def test_auto_discovery
Expand Down

0 comments on commit 06dd7b8

Please sign in to comment.