# Recognize\_path discrepency

**URL:** <https://www.ruby-forum.com/t/recognize-path-discrepency/85139>\
**Category:** Rails\
**Created:** [February 10, 2007, 12:43pm UTC](https://www.ruby-forum.com/t/recognize-path-discrepency/85139 "2007-02-10T12:43:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 10, 2007, 12:43pm UTC](https://www.ruby-forum.com/t/recognize-path-discrepency/85139/1 "2007-02-10T12:43:01Z")

</div>

hey all - wondering if someone would relive my confusion…

given a model called say Meeting and a route as  
“map.resources :meetings”

in the console:

> > r=ActionController::Routing::Routes  
> > r.recognize\_paths “/meetings”  
> > =\>{:action=“index”,:controller=\>“meetings”}

all works as I expect, but if I do

> > r.recognize\_paths “/meetings/1”  
> > =\>{:action=“1”,:controller=\>“meetings”}

which is what Id expect for a map.connect, but not for a map.resources  
similarly

> > r.recognize\_paths “/meetings/1/new”  
> > =\>{:action=“1”,:controller=\>“meetings”,:id=\>“new”}

Does recognize\_path not work for map.resources, or am I doing  
something very wrong?

thanks  
Glenn

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 10, 2007, 3:27pm UTC](https://www.ruby-forum.com/t/recognize-path-discrepency/85139/2 "2007-02-10T15:27:18Z")

</div>

Heh. I thought I’d pitch in this morning but I get

NoMethodError: undefined method `recognize\_paths’ for  
#ActionController::Routing::RouteSet:0xb787cfb4

I tried recognize\_path but it seems to be looking for more information  
than  
I’m giving it based on your code there.

> > r.recognize\_path “/admin/users”  
> > ActionController::RoutingError: no route found to match “/admin/users”  
> > with  
> > {}  
> > from  
> > ./script/…/config/…/config/…/vendor/rails/actionpack/lib/action\_controller/routing.rb:1299:in  
> > `recognize\_path’  
> > from (irb):6
> 
> > r.recognize\_path “admin/users”  
> > ActionController::RoutingError: no route found to match “admin/users”  
> > with  
> > {}  
> > from  
> > ./script/…/config/…/config/…/vendor/rails/actionpack/lib/action\_controller/routing.rb:1299:in  
> > `recognize\_path’  
> > from (irb):7
> 
> > r.recognize\_path “/admin/users/”  
> > ActionController::RoutingError: no route found to match “/admin/users/”  
> > with  
> > {}  
> > from  
> > ./script/…/config/…/config/…/vendor/rails/actionpack/lib/action\_controller/routing.rb:1299:in  
> > `recognize\_path’  
> > from (irb):8
> 
> > r.recognize\_path “/admin/users/new”  
> > ActionController::RoutingError: no route found to match  
> > “/admin/users/new”  
> > with {}  
> > from  
> > ./script/…/config/…/config/…/vendor/rails/actionpack/lib/action\_controller/routing.rb:1299:in  
> > `recognize\_path’  
> > from (irb):9

I will say that the results you’re getting aren’t what I’d expect but I  
can’t seem to manage to make them for myself.

RSL

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 10, 2007, 4:03pm UTC](https://www.ruby-forum.com/t/recognize-path-discrepency/85139/3 "2007-02-10T16:03:25Z")

</div>

sorry to top post… but it in your case would it be you havent set  
routes up for this?

glenn

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 10, 2007, 4:53pm UTC](https://www.ruby-forum.com/t/recognize-path-discrepency/85139/4 "2007-02-10T16:53:28Z")

</div>

That’s why I used “/admin/users” as a path [something I _do_ have a path  
for  
in my routing] instead of what you were using. 😉 If you look at that  
empty  
hash there, that’s the problem. It’s looking for a params hash most  
likely  
but I haven’t mucked around in the source looking for documentation so I  
can’t tell for sure.

RSL
