Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image_tag not working #9

Closed
bcackerman opened this issue Jul 2, 2014 · 3 comments
Closed

Image_tag not working #9

bcackerman opened this issue Jul 2, 2014 · 3 comments
Labels

Comments

@bcackerman
Copy link

Everything works great except forimage_tag's in our emails. We have S3/Cloudfront setup with our image assets. The image src that is trying to be rendered is the local path to the image, not the Cloudfront link to the file like it would normally in our views.

Not sure if this is a bug or I haven't set something up correctly...

@Mange
Copy link
Owner

Mange commented Jul 3, 2014

Have you set up Rail's asset_host setting in the environment you are
rendering the email in? Rails should use the asset host when outputting the
image tags.

We have bug #10 for problems with having the stylesheet inlined with an
asset_host set, so I think that you might have to sacrifice something in
your setup to have this work until that is fixed.
Den 2 jul 2014 23:05 skrev "Bruce Ackerman" notifications@github.com:

Everything works great except forimage_tag's in our emails. We have
S3/Cloudfront setup with our image assets. The image src that is trying to
be rendered is the local path to the image, not the Cloudfront link to the
file like it would normally in our views.

Not sure if this is a bug or I haven't set something up correctly...


Reply to this email directly or view it on GitHub
#9.

@bcackerman
Copy link
Author

Yes we have asset_host set. Would using just the roadie gem not the roadie-rails gem get image_tags working?

@Mange
Copy link
Owner

Mange commented Jul 8, 2014

The thing is that roadie-rails doesn't touch image_path or image_tag at all. It only looks for rendered <img> with src that is not absolute (without a protocol part, IIRC). The easiest fix for you is to use the normal Rails helpers for images (image_tag, etc.).

Rails already does a lot of the URL rewriting features that Roadie provides. It should be enough for most people, I hope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants