title: Deleting images with paperclip
body: <p>I'm trying to delete each single image uploaded for a model (work has many images) but now my code works like this: I have three images uploaded in a work, I want to delete just one but when I check the image's checkbox and submit the update action it will delete all the three images.</p>
  
  <p>Here is my work model's code:</p>
  
  <pre><code>  before_save :destroy_image?
  
    belongs_to :category
    has_many :images, :as =&gt; :assetable, :class_name =&gt; "Work::Image", :dependent =&gt;    :destroy
  
    accepts_nested_attributes_for :images, :reject_if =&gt; proc { |attributes| attributes['attachment'].blank? }
  
    def image_delete
      @image_delete ||= "0"
    end
  
   def image_delete=(value)
     @image_delete = value
   end
  
  private
     def destroy_image?
      self.images.clear if @image_delete == "1"
     end
  
  
  end
  
  
  class Work::Image &lt; Asset
     has_attached_file :attachment, :styles =&gt; {:small =&gt; "200x150&gt;", :large =&gt;    "400x300&gt;"},
  :url  =&gt; "/uploads/works/:id/:style/:basename.:extension",
  :path =&gt; ":rails_root/public/uploads/works/:id/:style/:basename.:extension"
  
  end
  </code></pre>
  
  <p>I think the problem is that delete all images </p>
  
  <pre><code>self.images.clear if @image_delete == "1"
  </code></pre>
  
  <p>but I don't understand how to fix it. I hope in your help. </p>