Hello everyone,
I’m working on a Rails app that uses an external asset host for images
and such. I’ve got my app configured to use the asset host in the
environment file. The URL to the asset host is properly rendered when
using an image_tag in the view per example (it will correctly set the
src to http://asset.host.url/assets/myimage.png instead of
/assets/myimage.png).
I’m using paperclip to attach images to my models, and I want to specify
a default URL for models that don’t have an image. I traced the logic
being used by image_tag to
ActionView::Helpers::AssetTagHelper::AssetPath#compute_public_path, but
I can’t seem to figure out how to call this logic from outside of my
views.
Can anyone enlighten me as to how to do this correctly?
Regards,
Mark