Reputation: 5755
I added the following in my production.rb environment file.
config.action_mailer.default_url_options = {host: "domain.com"}
<%= tag("img", src: image_url("logo.png")) %>
However, when I look at the path in my email, I see a image_path, not URL.
What am I doing wrong?
Upvotes: 1
Views: 1409
Reputation: 452
This is how it works in my application. Try this
<%= image_tag(attachments['logo.png'].url, style: 'margin: 5px') %>
Upvotes: 1
Reputation: 273
You need to specify config.action_mailer.asset_host = "domain.com"
in production.rb. Then use image_tag
in your mailer view.
Upvotes: 1