Hi,
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:
<a onclick="if (confirm('Are you sure?')) { var f =
document.createElement('form'); f.style.display = 'none';
this.parentNode.appendChild(f); f.method = 'POST'; f.action =
this.href;var m = document.createElement('input');
m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method');
m.setAttribute('value', 'delete'); f.appendChild(m);var s =
document.createElement('input'); s.setAttribute('type', 'hidden');
s.setAttribute('name', 'authenticity_token'); s.setAttribute('value',
'LgNwcxaXQ3+NT95f1SJYo1ZOUfXMFtQimzSzDmjJM3g=');
f.appendChild(s);f.submit(); };return false;" href="/photos/
51">Destroy</a>

as you can see its still post, but it has hidden input that tells your
controller about delete.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to