Rating Plugin

Hi,

I wanna rate an object on multiple criteria
Like..
Benefits
Applicability

etc..

So i would want the user to rate an object on 2 criteria.
Is there any plugin which will suit my need.Acts_as_rateable allows only
rating on a single context..

Thanks In Advance..

Charanya Nagarajan

I think you will have to modify a plugin manually, I don’t know a plugin that does it automatically. But it shouldn’t be hard.

Hi,

As Philipe mentioned you have to modify the plugin little bit to match
your requirement.

Lets say you are using acts_as_ratable plugin, so they will use rate
column to specify the rate.

You just add few more columns like benefit_rate, applicability_rate,
quality_rate and what ever you want.

So in your rate method, you need to modify it little bit.

From this:

@post.rate( 4, current_user.id )

def rate(rating_value, user_id)
r = Rate.new
r.rate = rating_value
r.rateable = self
r.user_id = user_id
r.save
end

To this:

@post.rate( 4, 5, current_user.id )

def rate(benefit_rating, quality_rating, user_id)
r = Rate.new
r.benefit_rating = benefit_rating
r.quality_rating = quality_rating
r.rate = r.benefit_rating + r.quality_rating
r.rateable = self
r.user_id = user_id
r.save
end

Just your getting rating values for benefit_rating and quality_rating.
And also you can save the sum of benefit_rating and quality_rating in
rate column.

Hope this will work for you

Regards,
T.Veeraa.