I’m having difficulty understanding exactly what I have to do to provide a link to delete all of my “results”
I’m looking for something like:
<%= button_to 'Remove All', @results, delete_all %>
I’m using mysql.
EDIT
routes.rb:
Productfinder::Application.routes.draw do
resources :contacts
resources :helps
get "help/index"
resources :results
resources :extensions
resources :websites
resources :words
resources :results do
collection do
get 'remove_all'
end
end
get "home/index"
root :to => "results#index"
Maybe this will be helpful for you:
in routes.rb you should add:
in some view you can add this link:
and controller’s action (in app/controller/results_controller.rb):