I seem to be stuck on restful deletion.
I've got a person model and a wish model, a person has many wishes.
Here's my routes.rb (simplified)
map.resources :people do |people| people.resources :wishes end
Now I want to be able to delete a wish, and I try a link to person_wish_url(@wish.person, @wish, :method => :delete)
But the generated path doesn't seem to be recognized.
shadowfax:~/ssanta rick$ script/console Loading development environment (Rails 2.0.0)
include ActionController::UrlWriter
=> Object
person_wish_path(1, 2)
=> "/people/1/wishes/2"
person_wish_path(1, 2, :method => :delete)
=> "/people/1/wishes/2?method=delete"
irb ActionController::Routing::Routes recognize_path("/people/1/wishes/2")
ActionController::MethodNotAllowed: Only get, put, and delete requests are allowed. from /Users/rick/ssanta/vendor/rails/actionpack/lib/action_controller/routing.rb:1436:in `recognize_path' from (irb#1):1
recognize_path("/people/1/wishes/2?method=delete")
ActionController::RoutingError: No route matches "/people/1/wishes/2?method=delete" with {} from /Users/rick/ssanta/vendor/rails/actionpack/lib/action_controller/routing.rb:1438:in `recognize_path' from (irb#1):2
recognize_path("/people/1/wish/2?method=delete")
ActionController::RoutingError: No route matches "/people/1/wish/2?method=delete" with {} from /Users/rick/ssanta/vendor/rails/actionpack/lib/action_controller/routing.rb:1438:in `recognize_path' from (irb#1):3
Where am I going wrong?