From 9514e4e6ad2d52b0a357b4558cddceb110f5e9ab Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 4 Sep 2006 20:25:43 +0000 Subject: Deprecated the auto-appending of .png to AssetTagHelper#image_tag calls that doesn't have an extension [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4999 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/asset_tag_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 2d9d7556eb..1f48ab224d 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -122,6 +122,14 @@ 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_path(source) + unless (source.split("/").last || source).include?(".") || source.blank? + ActiveSupport::Deprecation.warn( + "You've called image_path with a source that doesn't include an extension. " + + "In Rails 2.0, that will not result in .png automatically being appended. " + + "So you should call image_path('#{source}.png') instead" + ) + end + compute_public_path(source, 'images', 'png') end -- cgit v1.2.3