The rails cast even gives a great section about using JQuery instead of Prototype - and how there's a specific rails.js for JQuery. But I definitely had issues getting this going until today - so hence the blog entry and a mistake perhaps that is not published yet on other posts.
First some background.
In scaffolding or even in your own coding, you may write a link that looks like this:
<%= link_to "Delete", @resource, :method => delete, :confirm => "Are you sure? %>
Now the thing to know about this is - this generates a link with specific attributes. And its those attributes that identify it as a special link. What identifies it as a special link? rails.js
Rails.js will look at links like this - dynamically create a form around this link, and then submit it when you click on the link. That's why the replacing this with "button_to" solves the problem in one way. Because button_to creates that form for you, and doesn't rely on rails.js to create that form.
Now the problem is - the default rails.js that's included in Rails 3.0 and below relies on Prototype. So if you switch to using JQuery - the default rails.js isn't going to work.
This is where the Railscast gives a good explanation to hit up the jquery-ujs github account (just Google jquery-ujs and you'll find it), and download the rails.js that exists there.
(and believe me if you do the steps right - you will be good to go).
I, however, did not do the steps correctly.
I followed the logic and followed the instructions and still things were breaking.
What did I do wrong?
Something really stupid. I downloaded the jquery-ujs/rails.js file incorrectly. I was using my browser and just right-clicked and "Save link as...". The problem is - I wasn't downloading the raw source code file which is what you need. The best way to do this is when in Github, jquery-ujs, click on src, then click on "rails.js". Then click on the "RAW" button to grab the actual source file. This was the key.
So just in case anybody else runs into this issue, make sure the rails.js file you're getting is the true raw source code file.
So all the information was already out there - I just made a stupid mistake that maybe some of you might run into so I thought I'd blog about it.