# Complex restful routes

**URL:** <https://www.ruby-forum.com/t/complex-restful-routes/138115>\
**Category:** Rails\
**Created:** [May 20, 2008, 10:14am UTC](https://www.ruby-forum.com/t/complex-restful-routes/138115 "2008-05-20T10:14:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 20, 2008, 10:14am UTC](https://www.ruby-forum.com/t/complex-restful-routes/138115/1 "2008-05-20T10:14:42Z")

</div>

Hi,

i’d like to know how you handle complex restful routes  
for instance  
table - join - table2  
or  
set has\_many subset has\_many subsubset  
won’t the route get a bit awkward ? I’d like to avoid having more  
than 2 models in my routes.

How would you handle this ? would you do:  
map.resources :set, :has\_many =\> :subset  
map.resources :subset, :has\_many =\> :subsubset  
?  
this is not ideal as the subset model gets complex to handle both  
types of routes.  
How do you do it ? Namespaces ?

Elise

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 20, 2008, 10:43am UTC](https://www.ruby-forum.com/t/complex-restful-routes/138115/2 "2008-05-20T10:43:08Z")

</div>

removed\_email\_address@domain.invalid wrote:

> How would you handle this ? would you do:  
> map.resources :set, :has\_many =\> :subset  
> map.resources :subset, :has\_many =\> :subsubset  
> ?  
> this is not ideal as the subset model gets complex to handle both  
> types of routes.  
> How do you do it ? Namespaces ?
> 
> Elise  
>   
> Hi Elise

I had a question about RESTful stuff last week, and I got some good  
general design tips as part of the help that I received.

[http://www.ruby-forum.com/topic/153102#new](http://www.ruby-forum.com/topic/153102#new)

Perhaps there may be something in there that can help the way you attack  
the problem.

I unfortunately, am still a REST-noob, so would rather not venture an  
answer.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 20, 2008, 11:28am UTC](https://www.ruby-forum.com/t/complex-restful-routes/138115/3 "2008-05-20T11:28:36Z")

</div>

thanks - it’s indeed a start of a pointer.

Elise

On May 20, 10:42 am, Rory McKinley [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
