When using active storage, one can delete images like so:
@file = ActiveStorage::Attachment.find(params[:id])
@file.purge
However, this only deletes the database records.
How do you clean up files on the server when deleting attachments using ActiveStorage?
The documentation for
purge
says that it does delete the file off of the server: