REST destroy link generate problem

Posted by Wei on Stack Overflow See other posts from Stack Overflow or by Wei
Published on 2010-04-02T15:37:43Z Indexed on 2010/04/02 15:43 UTC
Read the original article Hit count: 164

Filed under:
|

I am using rails beta 3 and I have a erb page named index.html.erb for discussions controller. In that page, I have a link as following: <%= link_to 'Delete', {:action=>'destroy', :id=>@discussion}, :confirm=>"Are you sure", :method=>'post' %>

Which is supposed to generate a link to delete a discussion, however, the generated html is Delete

which always routes to the show action. I think the href should be /discussions/destroy/1. But for some reason it is not.

Any ideas? Thanks in advance.

© Stack Overflow or respective owner

Related posts about rails

Related posts about ruby-on-rails