Saving the cloudinary URL for images after uploaded via widget
There's no documentation on what to do with the Upload Widget V2 AFTER the success callback. I don't need to save all that image information, I was planning on only saving the cloudinary cdn url. In a previous forum post a moderator said that we're not supposed to save the cdn url directly, we're supposed to save the public_id. But if I do that, how do I structure my `img` tags when I want `thumbnail` as opposed to `standard`?
-
Right now in the success callback I save the public_url and in the view use:
`<%= cl_image_tag(@user.avatar, :width=>160, :height=>160, :crop=>"scale") %>`
But instead of scaling on the fly I'd like to just display the scaled image which I know was saved.
So something like
`<%= cl_image_tag(@user.avatar.thumbnail) %>`
0 -
When saving the public id, you can use it to generate the img tag. For example
cl_image_tag("sample", :transformation => { :width => 400, :crop => "pad" })
If you just want to generate URL you might want to use:
cloudinary_url("sample.jpg", :width=>300, :height=>100, :crop=>"scale")
0
Post is closed for comments.
Comments
2 comments