# Polymorphic nested resources

**URL:** <https://www.ruby-forum.com/t/polymorphic-nested-resources/160212>\
**Category:** Rails\
**Created:** [February 13, 2009, 1:11am UTC](https://www.ruby-forum.com/t/polymorphic-nested-resources/160212 "2009-02-13T01:11:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [February 13, 2009, 1:11am UTC](https://www.ruby-forum.com/t/polymorphic-nested-resources/160212/1 "2009-02-13T01:11:57Z")

</div>

Hello list,

What if I have a model called address that is polymorphic, and I also  
have  
an address resource (as I want to try to follow a RESTful design) – how  
could I make “polymorphic” nested associations between addresses  
controller  
and other related resources (users/1/addresses **and**  
orders/3/addresses).  
What would be the easiest way to accomplish something like that?

Thanks,

Marcelo.

---

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [February 13, 2009, 1:35am UTC](https://www.ruby-forum.com/t/polymorphic-nested-resources/160212/2 "2009-02-13T01:35:21Z")

</div>

> **[Insight: Medical Device Software Articles and Resources](https://orthogonal.io/insights/)**
>
> Orthogonal provides timely news, literature reviews, articles, white papers, and commentary for a medical device manufacturing audience.

I think the article above pretty much answers my question. But please,  
if  
anyone out there has any thoughts about it, I would love to know!

Thanks,

Marcelo.

On Thu, Feb 12, 2009 at 6:10 PM, Marcelo de Moraes S. \<
