paperclip - deleting a photo from a form

Any tips as to how paperclip can be used to delete photos.

I mean that in my update view I show six browse buttons, all capable of updating the photo that corresponds to that browse button (e.g. photo1 or photo2). That works, what if the user wants to delete one of those photos, how do I do that?

bb

bingo bob wrote:

Any tips as to how paperclip can be used to delete photos.

I mean that in my update view I show six browse buttons, all capable of updating the photo that corresponds to that browse button (e.g. photo1 or photo2). That works, what if the user wants to delete one of those photos, how do I do that?

bb

Looking to find out what I need to do in my view and in my controller.

Anyone have any tips on this one? I suppose I may need an additional action in my controller to cope with deletion of a particular photo and then re-render the edit view..

For reference, here's the edit view for an advert, as I say, I'm trying to integrate a fiunction that allows users to delete one of the photos (1 to 6), any clues as to what i might do in this form / controller.

<h1>Editing advert</h1>

<div id="advert_images">

<%= render :partial => "images", :locals => { :advert => @advert } %>

</div>

<% form_for @advert, :html => { :multipart => true } do |f| %>

  <%= f.error_messages %>

<ul>   <li><%= f.file_field :photo1%></li>   <li><%= f.file_field :photo2%></li>   <li><%= f.file_field :photo3%></li>   <li><%= f.file_field :photo4%></li>   <li><%= f.file_field :photo5%></li>   <li><%= f.file_field :photo6%></li> </ul>   <p>     <%= f.label :title %><br />     <%= f.text_field :title %>   </p>   <p>     <%= f.label :description %><br />     <%= f.text_area :description %>   </p>

  <p>     <%= f.submit "Update" %>   </p> <% end %>

<%= link_to 'Show', @advert %> | <%= link_to 'Back', adverts_path %>