rubybox
2010-Aug-06 09:47 UTC
Smart way to add comments possibility on a model base to an app?
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! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ar Chron
2010-Aug-06 13:41 UTC
Re: Smart way to add comments possibility on a model base to an app?
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/ ] 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. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.