# Question about routing polymorphic associations, especially RAILS EDGE

**URL:** <https://discuss.rubyonrails.org/t/question-about-routing-polymorphic-associations-especially-rails-edge/16819>\
**Category:** rubyonrails-talk\
**Created:** [August 9, 2007, 9:25pm UTC](https://discuss.rubyonrails.org/t/question-about-routing-polymorphic-associations-especially-rails-edge/16819 "2007-08-09T21:25:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielFischer.com](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@DanielFischer.com](https://discuss.rubyonrails.org/u/DanielFischer.com)\
**Post date:** [August 9, 2007, 9:25pm UTC](https://discuss.rubyonrails.org/t/question-about-routing-polymorphic-associations-especially-rails-edge/16819/1 "2007-08-09T21:25:40Z")

</div>

I have a question regarding edge rails. The new routes syntax is:

map.resources :blog, :has\_many =\> :posts.

Now my question is how would I further specify the association? I want :posts to 'has\_many :comments'.

But you can't do:

map.resources :blog, :has\_many =\> :posts(:has\_many =\> :comments)

You can tell what I mean.

I don't think it makes sense to do map.resources :posts, :has\_many =\> :comments because the whole point of nesting posts is so you can't get it by itself. So how do I further nest it?

I tried something like this:

&nbsp;&nbsp;map.resources :shows do |shows| &nbsp;&nbsp;&nbsp;&nbsp;shows.resources :has\_many =\> :episodes do |episode| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;episode.resources :has\_many =\> :comments &nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;end

and did rake routes but I didn't see anything like /shows/:id/ episodes/:id/comments/new

Help would be greatly appreciated, thanks.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Linowes](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/jonathan_linowes/32/2572_2.png) [@Jonathan\_Linowes](https://discuss.rubyonrails.org/u/Jonathan_Linowes)\
**Post date:** [August 10, 2007, 3:02am UTC](https://discuss.rubyonrails.org/t/question-about-routing-polymorphic-associations-especially-rails-edge/16819/2 "2007-08-10T03:02:30Z")

</div>

Hi, afaik, if you want to use that syntax, rails edge endorses (enforces?) the notion that resources need not (should not) be nested more than one level deep in the url, because more is redundant. When you say /blog/12/posts/3/comments the blog\_id is know from the @post record. Thus, /posts/3/comments is sufficient, and all that is supported.
