Delete images with active storage in rails app?
I am using this tutorial ->https://www.youtube.com/watch?v=fJ8kD4de72Q. 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 -> https://medium.com/@abhishek.kanojia/from-paperclip-to-active-storage-749f7954e8d3
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: https://stackoverflow.com/questions/52170764/active-storage-purge-method-throws-undefined-method-signed-id-for-nilclass/52171476#52171476