Images not served in production via image_tag in Rails 4 -
i deployed app production , noticed images not served image_tag, served if use asset_path. have images under app/assets/images. on production precompile them in public/assets , have names such 'image_name-fk3r23039423-0e9232.png'.
when @ html code generated see image_tag's src
/images/logo
while asset_path generates this:
/assets/login-bg1-01eead5b47afcb7e0a951a3668ec3921e8df3f4507f70599f1b84d5efc971855.jpg
so correct. interested why can not serve images using image_tag 'image-name'?
here production.rb
config.serve_static_files = true config.assets.compile = false config.assets.digest = true
i resolved adding extension file. i.e did this:
<%= image_tag 'logo.png'%> # added .png
i don't know why didn't worked without extension in development. suppose logo image served application assets, not public.
Comments
Post a Comment