# Polymorphic DRYness? (Acts as Commentable)

**URL:** <https://www.ruby-forum.com/t/polymorphic-dryness-acts-as-commentable/143706>\
**Category:** Rails\
**Created:** [July 22, 2008, 1:09am UTC](https://www.ruby-forum.com/t/polymorphic-dryness-acts-as-commentable/143706 "2008-07-22T01:09:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Sav](https://www.ruby-forum.com/u/Sav)\
**Post date:** [July 22, 2008, 1:09am UTC](https://www.ruby-forum.com/t/polymorphic-dryness-acts-as-commentable/143706/1 "2008-07-22T01:09:56Z")

</div>

I’m using the polymorphic “acts\_as\_commentable” plugin…

> **[Acts As Commentable Plugin](http://juixe.com/techknow/index.php/2006/06/18/acts-as-commentable-plugin/)**
>
> I am happy to announce that I have released the acts\_as\_commentable plugin, my first Ruby on Rails plugin. The Acts As Commentable plugin allows for comments to be added to your Rails ActiveRecord …

> **[Comments on Acts As Commentable](http://juixe.com/techknow/index.php/2006/07/09/comments-on-acts-as-commentable/)**
>
> I have received a bit positive feeback rearding the acts\_as\_commentable rails plugin. One suggestion asked for me to provide more sample code, especially in regards to the view and controller. To f…

But I’m new to RoR and don’t understand how to avoid repeating myself.

Is there a way to create a single “comment\_form” partial and action to  
handle any model type/id? The second link above assumes an @model  
model rather than being able to handle any model.

Any insight would be greatly appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![Sav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Sav](https://www.ruby-forum.com/u/Sav)\
**Post date:** [July 22, 2008, 2:32am UTC](https://www.ruby-forum.com/t/polymorphic-dryness-acts-as-commentable/143706/2 "2008-07-22T02:32:58Z")

</div>

Nevermind, this group already answered my question here…  
[http://groups.google.com/group/rubyonrails-talk/browse\_thread/thread/51ac9daee6679a86/fafcf7c119779acb?lnk=gst&q=comments+controller#fafcf7c119779acb](http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/51ac9daee6679a86/fafcf7c119779acb?lnk=gst&q=comments+controller#fafcf7c119779acb)

Thanks!
