# How to declare a member for a restful resource when it has a nested resource

**URL:** <https://www.ruby-forum.com/t/how-to-declare-a-member-for-a-restful-resource-when-it-has-a-nested-resource/156900>\
**Category:** Rails\
**Created:** [January 5, 2009, 3:18am UTC](https://www.ruby-forum.com/t/how-to-declare-a-member-for-a-restful-resource-when-it-has-a-nested-resource/156900 "2009-01-05T03:18:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorelal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3da27b/32.png) [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Post date:** [January 5, 2009, 3:18am UTC](https://www.ruby-forum.com/t/how-to-declare-a-member-for-a-restful-resource-when-it-has-a-nested-resource/156900/1 "2009-01-05T03:18:19Z")

</div>

Currently my routes.rb looks like this.

map.resources :cities do |cities|  
cities.resources :venues, :collection =\> {:transfer =\> :any}  
end

Now I have a need to declare something like

map.resources :cities, :collection =\> {:manage =\> :get}

But since I have a nested resource for cities I am not sure what the  
syntax is to declare a collection on cities?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![dorelal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3da27b/32.png) [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Post date:** [January 5, 2009, 4:08am UTC](https://www.ruby-forum.com/t/how-to-declare-a-member-for-a-restful-resource-when-it-has-a-nested-resource/156900/2 "2009-01-05T04:08:07Z")

</div>

The collection and other options are just a hash being passed as  
parameters to the resources method. The ruby language defines all  
parameters before blocks in method calls. Try the following:

map.resources :cities, :collection =\> {:manage =\> :get} do |cities|  
cities.resources :venues, :collection =\> {:transfer =\> :any}  
end
