If you upload the images from the server-side, then in order to use the original file name of the uploaded image for the public ID, you can add the following method to your upload:
Cloudinary::PreloadedFile.split_format(original_filename).first + "_" + Cloudinary::Utils.random_public_id[0,6]
When uploading from the client-side, you can use something like the following:
<%= form_for(@photo) do |f| %>
<%= f.cl_image_upload(:image, use_filename: true) %>
Please sign in to leave a comment.