I have a model called Tile, and it has attachment:
has_attachment :image_attachment
I can use cl_image_tag @tile.image_attachment.path
to display img tag but I want to get only full URL to embed is an background image in inline style, is there a way to get full URL?
``@tile.image_attachment.path returns
v1458814322/bgo1zuv4kji17f58x5m5.jpg
You just need to use cl_image_path(@tile.image_attachment)
If you want to access the URL somewhere else than in a view file:
options = {width: 50, height: 50, crop: :fill}
Cloudinary::Utils.cloudinary_url(image_id, options)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With