Open wazery opened 10 years ago
What is the method to get an average score from all users for an attribute?
hi,
you can try following:
@game.average("rating").avg
where "rating" is dimension defined in Game model in this case
hi,
I could not get @game.average("rating").avg to work. when I use this, it gives me an error undefined method `avg' for nil:NilClass
I am looking for the same method. Any solutions.
Thanks, Puja
What is your defined dimension in User model? Is it "rating" ?
Use this <%= package.average("user_rating").present? ? package.average("user_rating").avg : 0 %>
@Puja-K
Issue by legos Sunday Apr 07, 2013 at 20:44 GMT Originally opened as https://github.com/muratguzel/letsrate/issues/26
How would I get the average rating from all users for each attribute and also the average overall rating from all attributes? Also, is it possible to show a numerical value instead of the stars?