Skip to content

Instantly share code, notes, and snippets.

@mediasota
Created August 3, 2012 11:56
Show Gist options
  • Save mediasota/3246924 to your computer and use it in GitHub Desktop.
Save mediasota/3246924 to your computer and use it in GitHub Desktop.
Delete original image when using Paperclip/Rails 3
after_save :destroy_original
private
def destroy_original
File.unlink(self.photo.path)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment