Display Cloudinary image uploads
I've been trying to solve a problem I've got when trying to display images from Cloudinary. I setup everyhting accounding to the guide they provide and basically I need to upload images from Trix editor. All this works ok. I can create a new 'post' and add images and I can see them get uploaded to Cloudinary but when I go to the actual post I see a broken link to the image.
It links to something like:
and when I check the image over at Cloudinary the URL should be something like:
/views/active_storage/blobs/_blob.html.erb file looks like the default:
<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>"> <% if blob.representable? %> <%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %> <% end %> <figcaption class="attachment__caption"> <% if caption = blob.try(:caption) %> <%= caption %> <% else %> <span class="attachment__name"><%= blob.filename %></span> <span class="attachment__size"><%= number_to_human_size blob.byte_size %></span> <% end %> </figcaption> </figure>
Any ideas how to grab the image from the cloud instead of that weird looking local storage link?