1
votes

I'm Using rails and the cloudinary's gem with carrierwave. I would like make a URL from the controller:

url = myModel.url_field
options = { width: 200 }
Cloudinary::Utils.cloudinary_url(url, options)

But I only get the URL without the crop options

(The urls are only examples)

http://res.cloudinary.com/cloud/image/upload/v1458860591/logos/20160324170310.jpg

There is one way to get the url? like:

http://res.cloudinary.com/cloud/image/upload/w_200/v1458860591/logos/20160324170310.jpg

1
I'm facing the same problem with pycloudinary. I can either use cloudinary_url and get the options separte, or call CloudinaryImage and get the full url, but inside an img tag. Did you find a solution?gdvalderrama

1 Answers

2
votes

After some more searching I found an answer that's working for me in python, the same should work for the ruby version.

Basically, don't pass the width inside the options, place it directly:

Cloudinary::Utils.cloudinary_url(url, width=200)

This should give you the url with the width in it :)