I have a scenario where I need to send emails using a template written in SLIM. I fixed my environment/development.rb
with the following config
that I find necessary (also based from my research)
config.assets.precompile += %w( print.css )
config.serve_static_assets = true (still using Rails 4.1.16)
config.action_mailer.default_url_options = { host: 'http://localhost:3000' }
config.action_controller.asset_host = 'http://localhost:3000'
config.action_mailer.asset_host = config.action_controller.asset_host
I know it's pointing correctly to my root url on this step. Then In my mailer.html.slim
I have something like this:
div align="left" style="border-collapse: collapse; padding-left: 30px;padding-top: 30px;padding-bottom: 30px;float:left;"
a href="http://#{App.url}"
= image_tag "images/logo-old.png", style: "display:inline-block", border: "0", alt: App.name, width: 139, height: 44, title: App.name
I tried the following already:
= image_tag "logo-old.png"
= image_tag "assets/images/logo-old.png"
= image_url "logo-old.png"
Nothing's working but good thing its now showing the Alt
to know its still working by its path.
The current = image_tag
evaluates to :
src="https://ci5.googleusercontent.com/proxy/83z0D3PVOqx-FwFFMwztfYBs5CSWHiURyxSUP6cZ3dq7Zo47k9mNPgotrijVmmWGxPHqblRTGCePqN4RrfEhHh_665
MdAQ=s0-d-e1-ft#http://localhost:3000/images/images/logo-old.png"
Any idea why the app can't find the normal pipeline path?
Instead of images/images/logo-old.png
I need the assets/images/logo-old.png
Edit:
So for result comparison, if I do image_url "logo-old.png"
the path results to /assets/logo-old.png
If I do image_url "images/logo-old.png"
the path results to images/images/logo-old.png
My image is in app/assets/images/logo-old.png