Is there a way to set use_filename globally?
Is there a way to have the use_filename option always be set to true without having to pass it in each time?
I have a scenario where I'm writing an image to disk then wanting to have my model that is tied to Carrierwave save the file and handle the upload to Cloudinary. This works okay now, but I can't set use_filename = true as an option in my uploader class. It seems you can only set it in the Cloudinary::Uploader.upload() method or set it in either the cl_image_upload helper or a button with the cloudinary_params manually set.
It seems somewhere along the lines Carrierwave is calling the Cloudinary::Uploader class, but I'm not sure where. I was hoping you could do something similar to the other options you can set like process :convert => 'jpg' or similar, but doing that for use_filename doesn't appear to be an option.
Is there some way to set this in the class file?
Thanks,
Ben
-
Hi Ben,
If you're using CarrierWave without direct upload, you can add
cloudinary_transformation :use_filename=>true
.
If you are using direct upload, you should add:use_filename=>true
to the cl_image_upload_tag.0
Post is closed for comments.
Comments
1 comment