During production, the correct paths to my images are not called with the image tag, and the md5 fingerprint is not added. Image names (for example, "pretty_picture.jpg") are stored in the database. Precompilation files are present in the shared folder, including the manifest file.
When called using image_tag:
image_tag @test_question.question.image
I get:
<img src="/images/pretty_picture.jpg">
If I set config.assets.compile = true in production.rb, the image is displayed and I get:
<img src="/assets/images/pics/pretty/pretty_picture-e0df5012b6930cda4efaa866af22a63f.jpg" >
My hacking solution is to use (in HAML)
%img{src: "/assets/"+Rails.application.assets.find_asset(@test_question.question.image).digest_path}
In production.rb I have
config.assets.digest = true config.assets.enabled = true config.serve_static_files = false config.assets.compile = false
Setting config.assets.compile to true during production is not recommended. This seems like a very strange behavior on behalf of asterisks and an asset pipeline. Any idea what is wrong with using image_tag here?
source share