Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

method: => :delete not working and :confirm option ignored

After returning to an old Rails project I found none of the destroy/delete links worked and clicking cancel on the confirmation popup would still submit the link.

Example of my code is:

<%= link_to 'Delete', admin_user_path(@user), :confirm => 'Are you sure?', :method => :delete %>
like image 934
Chris Gaunt Avatar asked Dec 10 '08 06:12

Chris Gaunt


1 Answers

This problem occurs if you are using jQuery, and if not, then look for something like that:

In my case, I was using:

javascript_include_tag :all %>

And it was not working, but when I put it like:

javascript_include_tag :defaults %>

It worked!

like image 172
Anderson Avatar answered Nov 10 '22 07:11

Anderson