# Smart way to add comments possibility on a model base to an app?

**URL:** <https://www.ruby-forum.com/t/smart-way-to-add-comments-possibility-on-a-model-base-to-an-app/192823>\
**Category:** Rails\
**Created:** [August 6, 2010, 11:48am UTC](https://www.ruby-forum.com/t/smart-way-to-add-comments-possibility-on-a-model-base-to-an-app/192823 "2010-08-06T11:48:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubybox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rubybox](https://www.ruby-forum.com/u/rubybox)\
**Post date:** [August 6, 2010, 11:48am UTC](https://www.ruby-forum.com/t/smart-way-to-add-comments-possibility-on-a-model-base-to-an-app/192823/1 "2010-08-06T11:48:01Z")

</div>

What would be a smart way to Add a comment form and lists comments on  
a per model base?

Im building a social networking site and would like to have comments  
on certain contents. I could add a comment form for every model  
manually but what would be a better way to have comments added on a  
per model base ? Where I could add something in the model and it would  
include the comments, + new comment form?

Thx!

---

<div class="post-metadata">

**Author:** ![rubybox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rubybox](https://www.ruby-forum.com/u/rubybox)\
**Post date:** [August 6, 2010, 3:41pm UTC](https://www.ruby-forum.com/t/smart-way-to-add-comments-possibility-on-a-model-base-to-an-app/192823/2 "2010-08-06T15:41:39Z")

</div>

rubybox wrote:

> What would be a smart way to Add a comment form and lists comments on  
> a per model base?
> 
> Im building a social networking site and would like to have comments  
> on certain contents. I could add a comment form for every model  
> manually but what would be a better way to have comments added on a  
> per model base ? Where I could add something in the model and it would  
> include the comments, + new comment form?
> 
> Thx!

A comment is a comment is a comment, and as such, you need only one  
comment form. You should read up on partials, and multi-part forms  
(railscasts [[http://railscasts.com/](http://railscasts.com/) ] has some very good episodes that  
would answer your questions IIRC.

If you want your comments related to multiple models, then you should  
look into polymorphic associations.

All eminently do-able in Rails.
