I'm using Cloudinary and CarrierWave to upload images from my Rails application, and it works fine.
My requirement is that a user can have a one image, so if a user already have an image and if he/she uploads a new one the previous image should be overridden by the new one.
My problem is, when I upload the new image to Cloudinary it is not invalidating the previous image and hence old image is still shown as users image.
Then I found an option called invalidate
and tried to use it, but no luck.
This is my Cloudinary
class
class PictureUploader < CarrierWave::Uploader::Base
include Cloudinary::CarrierWave
version :show do
process :invalidate => true
end
end
and it my view
recipe.picture_url(:show)
but this shows the old image and not the new one. What am I missing?