I'm looking to add the capability of rating a model I have under several different categories like "Knowledgeable" "Organized", etc. Is there a plugin that will allow me to do this, and maybe even have a cool x/5 stars graphical representation as well?
A:
I don't think any of the ratings plugins support this, but you could make a model called CatgoricalRating
that is setup like this:
#This table has model_id, rating_category, and columns to support the rating system
class CatgoricalRating < ActiveRecord::Base
belongs_to :model
acts_as_rateable # (or any other rating plugin)
end
class Model < ActiveRecord::Base
has_many :categorical_ratings
end
Then any model can have any number of ratings through that relationship
You could even make it a has_many :through
where one model represents the categories, and the 'join' model associates one model with one category and also contains the rating information.
Daniel Beardsley
2010-05-18 08:33:44
Great idea, I'll try to implement it! Thanks! :)
Kevin
2010-05-18 18:50:34