# Get model from polymorphic association

**URL:** <https://www.ruby-forum.com/t/get-model-from-polymorphic-association/141322>\
**Category:** Rails\
**Created:** [June 24, 2008, 6:14pm UTC](https://www.ruby-forum.com/t/get-model-from-polymorphic-association/141322 "2008-06-24T18:14:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [June 24, 2008, 6:14pm UTC](https://www.ruby-forum.com/t/get-model-from-polymorphic-association/141322/1 "2008-06-24T18:14:51Z")

</div>

Hi,

If using a polymorphic belongs\_to, is it possible to access the “\_type”  
field that contains the name of the model ?

Thanks!

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [June 24, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/get-model-from-polymorphic-association/141322/2 "2008-06-24T18:50:46Z")

</div>

On 24 Jun 2008, at 17:14, John L. wrote:

> Hi,
> 
> If using a polymorphic belongs\_to, is it possible to access the  
> “\_type”  
> field that contains the name of the model ?

is it not accessible as any other attribute?

Fred
