# acts\_as\_double\_polymorphic\_join

**URL:** <https://discuss.rubyonrails.org/t/acts-as-double-polymorphic-join/22787>\
**Category:** rubyonrails-talk\
**Created:** [January 7, 2008, 5:51pm UTC](https://discuss.rubyonrails.org/t/acts-as-double-polymorphic-join/22787 "2008-01-07T17:51:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [January 7, 2008, 5:51pm UTC](https://discuss.rubyonrails.org/t/acts-as-double-polymorphic-join/22787/1 "2008-01-07T17:51:53Z")

</div>

Hi there again,

I posted something similar before and didn't get any answer, probably because I failed to put together a coherent question. I'll try to make it simple this time.

Having an association like this one:

class Attachment \< ActiveRecord::Base &nbsp;&nbsp;belongs\_to :attachable, :polymorphic =\> true &nbsp;&nbsp;belongs\_to :attacher, :polymorphic =\> true

&nbsp;&nbsp;acts\_as\_double\_polymorphic\_join :attachables =\> [:photos, :videos], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:attachers =\> [:typologies, :areas] end

I need to render a select list that contains all the possible attacher types and looks like this:

\<select name="attacher[id]"\> &nbsp;&nbsp;\<option value="Typology"\>Typologies\</option\> &nbsp;&nbsp;\<option value="Area"\>Areas\</option\> \</select\>

Is it possible? If so, how's the neatest way to do it?

Thanks again.

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [January 16, 2008, 8:52pm UTC](https://discuss.rubyonrails.org/t/acts-as-double-polymorphic-join/22787/2 "2008-01-16T20:52:26Z")

</div>

bump
