Re: link_to with :method=>:delete not working ( Rails 3 )

I did exactly that and wierd stuff happens. When I click cancel in the "Are you sure" dialog, the dialog closes and opens a new dialog, if I click cancel again it dosen't cancel the action.

I'm new to RoR, things like not getting a simple OK|Cancel dialog to work has several effects.It seriously pisses me off, someone obviously diden't test things properly

It's as bad as the fact that the rake 0.9.0 cannot even do a db:create and that I cannot use bundle to correct the rake version (fails). I had to change the Gemfile.lock by hand to get rake db:create to work. Which makes me wonder why is rake 0.9.0 still out there for download? Lots of people must have run into that one.

If you cannot trust the framework with such a simple tasks, what happens when you get into real problems?

It's sold as the answer to all our prairs. But the time you gain in development you quickly lose in s--t like this.

Geee, I think I'll stay of RoR (by the by I run on x86-mingw32, ruby 1.9.2, rails 3.0.7)

Re: link_to with :method=>:delete not working ( Rails 3 )

Hi all, This is problem of javascrpt-helper of rails. You need to use rails.js appropriately. If you use prototype.js then in rails.js you need prototype helpers methods else if you use jquery then you need rails jquery helper.This link ( https://raw.github.com/rails/jquery-ujs c/rails.js ) for jquery helper.

Re: link_to with :method=>:delete not working ( Rails 3 )

I had the same problem and looked around various sources of rails support and used the above suggestions to get my work-in-progress application running again after a version 3.1.1 upgrade. Since I was more familiar with Rails ver 2.x my knowledge of the changes is not in depth. In addition to the javascript rails.js providing the missing solution, I also needed to know where to place the file and this was not obvious.

To save other new converts time, you need to place the rails.js file in your applications ./app/assets/javascript directory.

Re: link_to with :method=>:delete not working ( Rails 3 )

Semi-old thread now, but for future reference:

I'm not sure how far back this stretches, but as of Rails 3.1, in order to use :method with the link_to helper, you need to require jquery_ujs in your application.js - prototype.js and rails.js is no longer used.

While Max Williams is correct regarding the semantics of using a button rather than a link, a working implementation of :method => [:post|:put|:delete] will create a mini-form, just as your buttons, as well as adding a rel=