I've got a Rails action that generates images from a DB, and it works
just fine. The url is like property/pictures/234234?n=1. It spits out
the image just fine.
However when I put this URL in an image_tag, it works but spits out
lots of messages about no file extensions and then adds a .png to the
end. Lucky, the .png doesn't break the action. Is there any way to
force rails to allow no extension on an image URL?
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", caller
# )
# end
compute_public_path(source, 'images')
end
If you don't want to do that, then you'll have to wait for Rails 2.0.