I have this in my routes.rb file:
resources :carts do
collection do
post :review
post :charge
end
end
Sometimes, when a user goes to /carts/review, instead of going to the review action, it instead tries to go to show with an id of review. I’ve gotten this error 3 times in production, and successfully reviewed the cart dozens of times. Any ideas on what might be happening?
This is Rails 3.2.1 running on Ubuntu 10.04 with ruby 1.9.1.
Your routes only accept the
POSTmethod for/carts/review. AGETto/carts/reviewwill be interpreted as/carts/:id, :id => "review"because there is noGETpath for/carts/reviewspecifically.