title: How can I remove Paperclip attachment using link_to?
body: <p>I've found this <a href="https://stackoverflow.com/questions/4435826/rails-paperclip-how-to-delete-attachment">solution</a> that uses a checkbox as a flag to delete the image. However, I want to use a <code>link_to</code>. Basically, next to the image attachment, I want to have a "Delete Avatar" link. If possible, I want the link to only delete the image, and not update the other attributes.</p>
  
  <p>User class</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_attached_file :avatar
    attr_accessible :avatar
  </code></pre>
  
  <p>In the form</p>
  
  <pre><code>link_to "Delete Avatar", {:action =&gt; :update}, :method =&gt; :put
  </code></pre>
  
  <p>Obviously this doesn't actually delete the image just yet. What would be the best way to do this? Have the link set a hidden flag and then update? Or is this just a bad idea (if so why)?</p>