views:

104

answers:

1

My delete/destroy is not working for rails 3.

Not for any scaffold or even for new projects.

   <%= link_to 'Destroy', card, :confirm => 'Are you sure?', :method => :delete %> 

From this question. Solution is Firefox reinstalation. But mine is also not working in chrome, safari or opera.

Html code generated:--

 <a href="/categories/1" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Destroy</a>
A: 

Make sure that you include default Rails javascript files in your layout.

<%= javascript_include_tag :defaults %>
Semyon Perepelitsa
@Semyon Perepelitsa Why should I, when i am using Jquery. Still for testing purpose i did that. Still no working.
piemesons
Rails 3 uses unobtrusive javascript to make it work. So you have to include some javascript framework (Prototype or JQuery) and proper `rails.js` for it. See [the screencast by Ryan Bates](http://railscasts.com/episodes/205-unobtrusive-javascript) for more information.
Semyon Perepelitsa