I am currently attempting to follow along with section 10.38 from RoR Tutorial. All is going well, but the delete user link is bringing me to the user’s profile page, rather than deleting the user. If I inspect the delete user link in chrome I see this:
<a href="/users/15" data-confirm="You sure?" data-method="delete" rel="nofollow" title="Delete Bob Johnson">delete user</a>
I have also included <%= javascript_include_tag :defaults %> as mentioned by Hartl in my application layout file.
I am running rails 3.1.3 and Ruby 1.9.3.
Thanks for your help!
The Hartl book has not been fully updated yet for Rails 3.1/3.2 (I think the first couple sections are available as a beta “second edition”). In Rails 3.1, you should be using
<%= javascript_include_tag "application" %>, not:defaults, otherwise thedata-method="delete"part won’t be handled properly.