Member route error

I'm getting a RoutingError for a member route I can't figure out. I'm
posting a simple form that has a submit button as a confirmation step.

Here's the route:

# routes.rb
resources :orders do
  post 'confirm', :on => :member
end

1) "rake routes" shows it's there:

confirm_order POST /orders/:id/confirm(.:format)
{:action=>"confirm", :controller=>"orders"}

2) Controller Orders defines confirm
3) HTML output shows the form is correctly set to post with action "/
orders/3/confirm"
4) Request header on the Routing Error page shows "POST /orders/3/
confirm HTTP/1.1"
5) My functional test passes: "post :confirm, :id =>
@order.to_param, :order => @order.attributes"
6) All other routes in routes.rb are disabled except the above

Everything seems to be correct but it's not working:

  No route matches "/orders/3/confirm"

If I change the request method on the route to "get" and simply view
in the browser it works. Help? :slight_smile:

Okay, I see now. There's a hidden input "_method" with value "put"
output automatically with my form. I needed to change my route to use
"put" instead of "post" to match what's happening behind the scenes.

My functional test was working with post so I couldn't see anything
wrong there, and it's odd because checking everything at the endpoints
showed a failed post request and not a (silent) put request. I had
thought about using put and this is probably more technically correct
because I'm modifying an existing object.