Skip to main content

Delete images with active storage in rails app?

Rails • Asked by Hilldamn

I am using this tutorial -> So I followed the Youtube video and it worked perfectly, but I want to add a feature so that the user can to delete the profile if they so choose to.

I will leave a link to all the code I used here ->

In the link to the Medium article that you reference the code from, there is a section included around deleting the images. Deleting associated avatar is as simple as doing: user.avatar.purge.
What exactly seems to be the issue?

Note: a GoRails user had a similar issue that they posted to StackOverflow:

Where do I insert the user.avatar.purge?

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.