How to fix routing error?

Working through the Depot application in Agile (and having lots of fun).
I’m on Iteration C3 - Handling Errors. I just added the flash to the
add_to_cart method in the store controller. Then I try the faulty URL
/store/add_to_cart/wibble to see my flash handle the error, but instead
I get this:

no route found to match
with {:method=>:get}

I tried googling this but no luck. I’ve proofread my additions to the
method and they appear correct. Any idea what this can be?

Still poking around with this and having no luck, but one thing I
noticed in the error message:

with {:method=>:get}

The book makes it explicit to use a post method of adding to cart,
making sure button_to was used instead of link_to:

<%= button_to “Add to Cart”, :action => :add_to_cart, :id => product %>

(Side note: then a couple pages later, they tell you to link the image
up to the add_to_cart method using link_to - making no sense whatsoever
to restricting it to a button in the first place)

Is this happening because hacking the URL is a GET vs. a POST?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs