You just cat you following in your view:
<%= link_to ‘Destroy’, photo, :confirm => ‘Are you sure?’, :method
=> :delete %>
and it appear in browser to that:
as you can see its still post, but it has hidden input that tells your
controller about delete.
Ah yes, of course, i had the feeling that rails handled this with a bit
of subterfuge but couldn’t remember quite how. I actually tried this
with a link_to_remote and the generated html was just a call to
jQuery.ajax with the delete method, just as i’d done it already, rather
than the code you posted up. I wonder if this is an issue with the
lets see if changing the method to post and adding “_method=delete” to
the data has the same effect…yes it does. Great, thanks Dmitry!