When I am on the index page and click on the delete link to destroy the post i get that error:
Unknown action
No action responded to delete. Actions: add, edit, and index
The edit link next to delete works with out a problem I do not understand why delete won’t work. This is what is in my controller car_controller.rb
def delete
@car = Car.find(params[:id])
flash[:notice] = "Question #{@car.name} deleted!"
@car.destroy
redirect_to :controller => :car, :action => :index
end
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
map.root :controller => "main"
map.root :controller => "car"
end
Isn’t the action for delete actually destroy?
If you look at a controller that was generated as part of scaffold, you should see what the delete action maps to…
Rails provides the 7 classical RESTful actions out of the box when you generate the controller and each one has the actual URL + method commented above the action method…
I hope this helps…