aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/asset_tag_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/asset_tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb8
1 files changed, 8 insertions, 0 deletions
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