Everybody's doing the thumb thing

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?

http://wiki.rubyonrails.org/rails/pages/UnderstandingPolymorphicAssociations

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs