The change to line 477 in the compute_public_path method of
actionpack/lib/action_view/helpers/asset_tag_helper.rb that
happened sometime between Rails 2.0 and Rails 2.1 is incorrectly
adding a period to the end of source when ext is nil (as in
image_tag) but the source exists as a file. This makes image_tag
work incorrectly on Tomcat, which will not serve up "foo.jpg.", but
will serve up "foo.jpg".
This is a show stopper critical bug in image_tag when running on
Tomcat and trying to upgrade from Rails 2.0.2 to Rails 2.1.2
Currently reads:
source += ".#{ext}" if ext && File.extname(source).blank? || File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}"))
Should read:
source += ".#{ext}" if ext && (File.extname(source).blank? || File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}")))
Besides creating a patch, it would be helpful to have a
workaround before the next Rails 2.1 release