All threads / Delete images with active storage in rails app?

Ask A Question


You’re not receiving notifications from this thread.

Delete images with active storage in rails app?

Hilldamn asked in Rails

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?

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 52,887+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.