cl_image_tag returning wrong URL with active storage
If I use image_tag I can get the proper URL out of my Image#asset but I can't get it working with cl_image_tag. Here is the repo with the call
https://github.com/bhoggard/art-collection/blob/main/app/views/admin/works/_thumbnails.html.erb
The tag comes back as:
<img width="100" src="https://res.cloudinary.com/tristanmedia/image/upload/q_auto/%23%3CActiveStorage::Attached::One:0x00007fc9572d1680%3E">
-
Hi Barry,
I saw you created a ticket with us directly, but I'll also ping a similar response here for reference in future.
If you try the below, does that work for you?
<%= cl_image_tag(image.asset.key, width: 100, quality: :auto) %>
If not, it may need accessing via the Attachment if the
key
property of the blob is not accessible:<%= cl_image_tag(image.asset.attachment.key, width: 100, quality: :auto) %>
How does the URL with the image tag look with those?
Post is closed for comments.
Comments
1 comment