ruby on rails - link_to() problem

Posted by Oded Harth on Stack Overflow See other posts from Stack Overflow or by Oded Harth
Published on 2011-01-08T14:35:48Z Indexed on 2011/01/08 14:53 UTC
Read the original article Hit count: 179

Filed under:

Hi,

I made this link in order to destroy a comment :

    <%= link_to 'Destroy Comment', [comment.post, comment],
    :confirm => 'Are you sure?',  :method => :delete %>

this suppose to send to the destroy action in the comments_controller.

the problem is that it searches for the 'show' action, Instead of the 'destroy' action :

   Unknown action

   The action 'show' could not be found for CommentsController

Do you think you know why it does that?

Thanks,

Oded

edit: problem solved I used 'button_to'

© Stack Overflow or respective owner

Related posts about ruby-on-rails