# How to limit map.resource

**URL:** <https://www.ruby-forum.com/t/how-to-limit-map-resource/195724>\
**Category:** Rails\
**Created:** [September 29, 2010, 4:57am UTC](https://www.ruby-forum.com/t/how-to-limit-map-resource/195724 "2010-09-29T04:57:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lambda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5f9b8f/32.png) [@lambda](https://www.ruby-forum.com/u/lambda)\
**Post date:** [September 29, 2010, 4:57am UTC](https://www.ruby-forum.com/t/how-to-limit-map-resource/195724/1 "2010-09-29T04:57:59Z")

</div>

Hi,

I am adding a new action in UsersController, the name is “drag\_demo”.  
But when I visit “[http://localhost:3000/users/drag\_demo](http://localhost:3000/users/drag_demo)”, it show up the  
error “Couldn’t find User with ID=drag\_demo”

I checked the routes. It seems the routes which created by map.resource  
will cover the url “/users/drag\_demo”. If I move “map.connect  
‘:controller/:action/:id’” to the top line in routes.rb, the problem  
will be solved. But the other actions like “/users/1/edit” will not  
availiable.

map.resources :users  
…  
map.connect ‘:controller/:action/:id’  
map.connect ‘:controller/:action/:id.:format’

Does anyone have ideas about that?  
Thanks in advance

-Edwin

---

<div class="post-metadata">

**Author:** ![lambda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5f9b8f/32.png) [@lambda](https://www.ruby-forum.com/u/lambda)\
**Post date:** [September 29, 2010, 5:13am UTC](https://www.ruby-forum.com/t/how-to-limit-map-resource/195724/2 "2010-09-29T05:13:43Z")

</div>

Problem solved. With the :collection option in map.resource, it work  
well.
