You know how on Youtube and many other sites you can either Thumbs Up + or Thumbs Down - a news story or comment. Okay, well I want to do this. I have a Model, Controller, Etc, for it, but I will use it for all of this: * Pictures * Comments * News Articles So, how can I set the model to -maybe- belong to many things. For example Rating could belong to News_Item. But then I have a Rating that belongs to Comment. How should I set this up in my database and in my RoR model? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
stephen.celis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Jan-22 00:40 UTC
Re: Everybody''s doing the thumb thing.
http://wiki.rubyonrails.org/rails/pages/UnderstandingPolymorphicAssociations On Jan 21, 6:26 pm, kopf1988 <kopf1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You know how on Youtube and many other sites you can either Thumbs Up > + or Thumbs Down - a news story or comment. Okay, well I want to do > this. I have a Model, Controller, Etc, for it, but I will use it for > all of this: > > * Pictures > * Comments > * News Articles > > So, how can I set the model to -maybe- belong to many things. For > example Rating could belong to News_Item. But then I have a Rating > that belongs to Comment. How should I set this up in my database and > in my RoR model?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---