I have this problem where I want to delete the file from s3 and have the system returns me the default url. However upon trying the code below and successfully deleting the files in s3, the url I get still points to s3.
I did the following code
user = User.first
user.profile_image.destroy
# i also tried
# user.profile_image.clear
render json: {profile_image: user.profile_image.url}
# the url that paperclip gives me is still points to the s3 server instead of my default picture link