mardi 28 avril 2015

AWS: external image links, Paperclip works, assets/ doesn't

I've got an app that sends templates through to Mailchimp, and my images are hosted with AWS. I use Paperclip too. The problem is that images that I upload via Paperclip work fine like this:

<img src="<%= URI.join(site, document.photo.image(:email)) %>">

But images like this break:

<img src="<%= URI.join(site, 'user_footer548.jpg') %>">

I'm not sure how to find the correct link for the latter. The image is in assets, and site is defined like so:

def site
  Rails.env.staging? ? 'http://staging.app.com/' : 'http://app.com/'
end

Any help would be great. Thanks.




Aucun commentaire:

Enregistrer un commentaire