# Recognize\_path and map.resources

**URL:** <https://www.ruby-forum.com/t/recognize-path-and-map-resources/104160>\
**Category:** Rails\
**Created:** [May 14, 2007, 9:54pm UTC](https://www.ruby-forum.com/t/recognize-path-and-map-resources/104160 "2007-05-14T21:54:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanatan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Post date:** [May 14, 2007, 9:54pm UTC](https://www.ruby-forum.com/t/recognize-path-and-map-resources/104160/1 "2007-05-14T21:54:00Z")

</div>

hi,

in script/console, when i do  
\>\> rs = ActionController::Routing::Routes  
\>\> puts rs.routes

the list includes  
GET /projects/  
{:controller=\>“projects”, :action=\>“index”}

but

> > rs.recognize\_path “/projects/”  
> > ActionController::RoutingError: no route found to match “/projects/”  
> > with {}  
> > from /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
> > action\_controller/routing.rb:1292:in `recognize\_path’  
> > from (irb):27  
> > from :0

and

> > rs.generate :controller =\> “project”  
> > ActionController::RoutingError: No route matches  
> > {:controller=\>“project”, :action=\>“index”}  
> > from /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
> > action\_controller/routing.rb:1266:in `generate’  
> > from (irb):26  
> > from :0

same with my other controllers  
but it works for named routes defined with map.connect and with map.\*

what am i missing?

---

<div class="post-metadata">

**Author:** ![johanatan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Post date:** [May 15, 2007, 12:43am UTC](https://www.ruby-forum.com/t/recognize-path-and-map-resources/104160/2 "2007-05-15T00:43:30Z")

</div>

For rs.recognize\_path “/projects/”, it’d be helpful to include the HTTP  
method. So…something like  
rs.recognize\_path “/projects/”, :method =\> :get  
should work.

-Tiffani A.B.
