Friday, January 18, 2013

Re: [Rails] Comment has_many comments

On 17 January 2013 18:32, Роман Пружанский <19prv94@gmail.com> wrote:
> Hi,
>
> I want to create web application where people can discuss some things.
> There will be a Posts and users can comment it, but I also want users can
> comment commentaries.
> Can I create model comment, that belongs_to comment and has_many comments,
> or smth similar?

I think what you are looking for is a self referential model. If you google for
rails self referential
you will find suggestions on how to do it. Start with some of the
later links however as the details of rails has changed over the
years. The basic principle is still the same though. My earlier
suggestion of working through tutorials to get the basics still stands
however, if you have not already done that.

Colin

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate