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.
-- 
Posted via http://www.ruby-forum.com/.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to