No commit activity in last 3 years
No release in over 3 years
Plugin that observe attachments and delete them when you trigger deletion by checking box in update form
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

PaperclipAttachmentRemover¶ ↑

This plugin used for delete attachment created by paperclip. It provides two methods for this:

attachment_remover_observe

used for to point out that attachment attributes needs to be observed for removing. You can point out multiple attributes with paperclip attachment

attachment_remover_name_for

used for getting correct form field name (usually checkbox) that should trigger attachment removing

Installation¶ ↑

sudo gem install PaperclipAttachmentRemover

Usage¶ ↑

In your model:

SomeThing << ActiveRecord::Base

  has_attachment :icon

  attachment_remover_observe :icon

end

In your update form:

form_for @something do |f|

  f.label :icon, 'Icon picture'
  f.file_field :icon

  f.label attachment_remover_name_for(:icon), 'Remove existing icon picture'
  f.check_box attachment_remover_name_for(:icon)

end

Copyright © 2010 v.valgis, released under the MIT license