Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How delete model with linked file

I see by default carrierwave does not delete files linked to model. How to do it?

like image 658
Oksana Avatar asked Dec 16 '25 16:12

Oksana


2 Answers

Carrierwave should remove the files from S3 automatically for you. I just tested this out on a Rails 3.1 app.

like image 143
Christian Fazzini Avatar answered Dec 19 '25 05:12

Christian Fazzini


You need to call

@image.destroy

not

@image.delete

Also use refresh button on aws s3 panel

like image 44
fatihpense Avatar answered Dec 19 '25 04:12

fatihpense



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!