Debugging a routing error

How do I debug a routing error?

I’ve been running examples from the Agile Rails book just fine to the
end of Chapter 8, cart creation. Then the next morning my installation
stopped working.

“no route found to match “/store” with {:method=>:get}”

attempting to debug:

rs = ActionController::Routing::Routes
rs.recognize_path “/store”
=> {:controller=>“store”, :action=>“index”}

the problem persists despite making the suggestion of changing

root_path = Pathname.new(root_path).cleanpath(true).to_s

in config/boot.rb for my rails 1.2.3 installation.

TIA

Ming -

On 14-Jul-07, at 2:46 PM, Ming wrote:

TIA
I’ve found Rick’s routing_navigator[1] plugin to be helpful.

Plus topfunky’s “REST Cheetsheet”[2] is a darling.

Jodi

[1] http://svn.techno-weenie.net/projects/plugins/routing_navigator/
[2] http://topfunky.com/clients/peepcode/REST-cheatsheet.pdf

what does your routes.rb look like?

“no route found to match “/store” with {:method=>:get}”

attempting to debug:

rs = ActionController::Routing::Routes
rs.recognize_path “/store”
=> {:controller=>“store”, :action=>“index”}

Jodi -

The pdf looks really cool… though at this stage of my railship, i’m
not sure what to make of it…

I might to install Edge Rails and Rick’s routing_navigator plugin to
get to the root of my problem

thanks.

routes.rb:

ActionController::Routing::Routes.draw do |map|
map.connect ‘:controller/:action/:id.:format’
map.connect ‘:controller/:action/:id’
end

On Jul 14, 3:16 pm, Matthew R. [email protected]

i fixed the problem by uninstalling and reinstalling the rails gem.

apparently i have a version of the elsewhere reported spurious routes
for rails 1.2.3 that doesn’t get fixed by adding realpath to
root_path:

root_path = Pathname.new(root_path).cleanpath(true).realpath().to_s

thanks to all who responded.

i meant to say that in boot.rb i changed

root_path = Pathname.new(root_path).cleanpath(true).to_s

to

root_path = Pathname.new(root_path).cleanpath(true).realpath().to_s

per

http://thenoobonrails.blogspot.com/2007/06/rails-12x-routing-issues.html

this has not helped…