Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete link goes to show method

I'm using Rails 3, i have a link_to with method :delete, but when i click this link it goes to the show action instead the destroy one.

my question is how to solve this problem?

thanks in advance.

code: <%= link_to 'Delete', list_path(@list.id), :method => :delete, :confirm => 'Are you sure?' %>

like image 906
Leonel Leonardis Avatar asked Jul 04 '12 20:07

Leonel Leonardis


1 Answers

You don't have the jquery and jquery_ujs libraries included by your application.js file, or you're not even including your application.js file in app/views/layouts/application.html.erb. This is typically done with this line:

<%= javascript_include_tag "application" %>
like image 200
Ryan Bigg Avatar answered Sep 30 '22 18:09

Ryan Bigg