How do I make a delete button that doesn't go to another page?

I'm trying to make a delete button for child objects. When the button
is pressed, I want the view to stay the same to protect whatever data
the user has entered already. When the button is pressed, it should
prompt "Are you sure?" and get an answer. I have most of this set
already, but I can't find a way to keep things from leaving the view.

Here's my code

  def destroy
    person = Person.find(params[:id])
    redirect_to(households_url) ---problem here,
but I have no idea what to put in it's place

<td><% if !person_form.object.new_record? %>
  <%= person_form.hidden_field :id, :index => nil %>
  <%= link_to 'Delete', person_path(, :confirm => 'Are you
sure?', :method => :delete %>
<% end %></td>

By the way, I'm running Rails 2.3.9 at the moment.

Bob <>

Have you considered making it an AJAX call?


Love to. Could you send me an example to start with?


Better than an example would be a tutorial, like:



Here's a good primer on how to do ajax calls using JQuery. These are
the skills you need to do this kind of work.

The only thing different is I'd recommend writing the javascript in
coffeescript instead.