Take the 2-minute tour ×  I'm using Paperclip to store images
for records called 'Expense' - images are of receipts for the
expense.  Everything works find, but when I go to edit an
expense, I want to have a link to delete the image associated
with that expense, so in my expense_controller, I have:  def
delete_receipt_img   @expense = Expense.find(params[:id])
redirect_to edit_expense_path(params[:id])  I generate the view
of the edit expense page with a partial that displays the delete
link only if an image is associated with the expense:  <% if
@expense.id.nil? || !@expense.receipt_img.file? %>     <%=
f.label :attach_receipt %><br/>     <%= f.file_field
:receipt_img %> <% else %>     <%= image_tag
@expense.receipt_img.url %>     <%= link_to "Delete Receipt",
:method => :put %> <% end %>  In my routes file, I followed an
example from the Rails routing guide, and created the link like
this:  resources :expenses do   member do    put
'delete_receipt_img'  When I go to the the edit expense