# How to handle nested and not nested resource in an action's controller?

**URL:** <https://www.ruby-forum.com/t/how-to-handle-nested-and-not-nested-resource-in-an-actions-controller/147084>\
**Category:** Rails\
**Created:** [August 28, 2008, 11:01am UTC](https://www.ruby-forum.com/t/how-to-handle-nested-and-not-nested-resource-in-an-actions-controller/147084 "2008-08-28T11:01:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adinda\_p](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5fc32e/32.png) [@adinda\_p](https://www.ruby-forum.com/u/adinda_p)\
**Post date:** [August 28, 2008, 11:01am UTC](https://www.ruby-forum.com/t/how-to-handle-nested-and-not-nested-resource-in-an-actions-controller/147084/1 "2008-08-28T11:01:49Z")

</div>

Hi list,

I don’t know whether the subject is understandable / what i really mean.  
I  
have a model which resources are nested and non-nested (CMIIW). Anyway,  
my  
routes.rb should explain:

map.resources :speeches, :collection =\> {  
:upload\_file =\> :get  
}

map.resources :bundles do |bundles|  
bundles.resources :speeches  
end

How to handle an action in SpeechesController, let’s say, index, for a  
different path, /speeches/ and /bundles/1/speeches/ ? Any reference to  
understand this area?

Thanks,

Dida
