This is an extension of the answer of Devin M.
You do not need to use JavaScript for this. You can simply pass the identifiers of the objects you want to delete to the routing assistant, for example:
<%= link_to "Delete these", destroy_many_items_path(:ids => [1,2,3]), :method => :delete ... %>
Then you will need to define this route in your file config/routes.rb:
resources :items do
collection do
delete :destroy_many
end
end
And then in your controller:
def destroy_many
items = Item.find(params[:ids])
items.each { |item| item.destroy }
...
end
:
def destroy_many
Item.where(:id => params[:ids]).delete_all
...
end