rickypai
rickypai

Reputation: 4016

How to prevent paperclip gem from deleting old files when new files are uploaded?

An app uses paperclip to handle file uploads for user avatars.

Paperclip currently deletes old files when new ones are files, however, I wish for the users to see a history of what they have uploaded.

Is there a way to prevent paperclip from deleting old files when new files are uploaded?

Thank you in advance,

Upvotes: 2

Views: 628

Answers (1)

Dylan Markow
Dylan Markow

Reputation: 124419

has_attached_file has a :keep_old_files options you can set. For example:

has_attached_file :avatar, :keep_old_files => true

Source: http://rubydoc.info/gems/paperclip/Paperclip/ClassMethods:has_attached_file

Upvotes: 4

Related Questions