ruby on rails - What value should I pass to paperclip to make it so that the file does not update? -


when update file in app, deletes , re-saves paperclip file. wan't pass in update_attributes allows paperclip ignore it, not delete current file. pass in?

i passing in file, deletes , resaves.

you might using

class user < activerecord::base    has_attached_file :attachment,   :url => :attachment_url,   :path => :attachment_path,   :default_url => "/images/sheet.png"  end  

try adding :preserve_files => false. way when add new file previous file reserved , not deleted.

final result

class user < activerecord::base    has_attached_file :attachment,   :preserve_files => false,   :url => :attachment_url,   :path => :attachment_path,   :default_url => "/images/sheet.png"  end   

check http://www.codesapling.com/blog/2014/01/10/saving-all-uploaded-attachments-with-paperclip/


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -