In index.html.erb
I display all products, and next to each product I have Edit
and Delete
actions:
<% @products.eac
Do you have rails.js
specified in a javascript_include_tag
? This is required for the unobtrusive DELETE
method to work. If you're using jQuery then there's a solution for that too.
I had same problem - actually I had changed my old 'delete' action to 'destroy' - but forgot If your using SSL.. (e.g ssl_required :destroy)
It needs to be product_path(product)
instead of product
in your delete link.
Dont forget to include jquery_ujs
in your application.js
file:
//
//= require jquery
//= require jquery_ujs
// ...