-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Paperclip
bbenezech edited this page Nov 9, 2011
·
6 revisions
Automatically detected.
One thing you may need is to add a delete method in your model.
Paperclip
does not include it, you'll need to add it manually.
RailsAdmin
will detect it and add a checkbox.
article.rb
class Article < ActiveRecord::Base
has_attached_file :asset
# add a delete_<asset_name> method:
attr_accessor :delete_asset
before_validation { self.asset.clear if self.delete_asset == '1' }
end