# Nested Resources vs. Normal Resources

**URL:** <https://www.ruby-forum.com/t/nested-resources-vs-normal-resources/111184>\
**Category:** Rails\
**Created:** [August 3, 2007, 4:51pm UTC](https://www.ruby-forum.com/t/nested-resources-vs-normal-resources/111184 "2007-08-03T16:51:21Z")\
**Posts on this page:** 2\
**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:** [August 3, 2007, 4:51pm UTC](https://www.ruby-forum.com/t/nested-resources-vs-normal-resources/111184/1 "2007-08-03T16:51:21Z")

</div>

Hi,

I’m a bit unsure as to when one uses a nested resource and when one  
uses a normal resource. If you have a belongs\_to, has\_one/many  
relationship between models is that automatically an indication of a  
nested resource or can these resources still be represented in the  
normal resource way?

I have a resource (talker) that belongs\_to a number of other models  
(network, data\_date, talker\_type etc) in a many to one relationship  
and I’d like to be able to have something like:

/networks/1/talkers/10  
/data\_dates/1/talkers/10  
/talker\_types/1/talkers/10

but also

/talkers/10

Is it possible to do this? or do I need to rename each of the nested  
parts of the url to something like network\_talkers etc. so that it  
would be:

/networks/1/network\_talkers/10

?

Thanks,  
Toby

---

<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:** [August 3, 2007, 4:57pm UTC](https://www.ruby-forum.com/t/nested-resources-vs-normal-resources/111184/2 "2007-08-03T16:57:22Z")

</div>

Don’t use nested resource unless you have a valid reason.

[http://groups.google.com/group/rubyonrails-core/browse\_thread/thread/f4ca7b1d420f6d7d/63a18f62d6cc7364?q=Nested+Resource&lnk=ol&](http://groups.google.com/group/rubyonrails-core/browse_thread/thread/f4ca7b1d420f6d7d/63a18f62d6cc7364?q=Nested+Resource&lnk=ol&)  
is a nice read.

On 8/3/07, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> (network, data\_date, talker\_type etc) in a many to one relationship  
> Is it possible to do this? or do I need to rename each of the nested
> 
> >

–  
Cheers!

- Pratik  
[http://m.onkey.org](http://m.onkey.org)
