Saving the cloudinary URL for images after uploaded via widget

Comments

2 comments

  • Avatar
    Broker Zoom

    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
    Comment actions Permalink
  • Avatar
    Shirly

    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
    Comment actions Permalink

Please sign in to leave a comment.