Here's a starting hint: http://ar.rubyonrails.org/classes/ActiveRecord/Calculations/ClassMethods.html
If you need more help than a hint, don't be afraid to ask. Bryan On Sat, Apr 28, 2012 at 6:07 PM, Jake K <[email protected]> wrote: > Hi all, > > I'm making a review application, and am working with two kinds of > items - "books" and "reviews", where books have many reviews and > reviews are children of books. Each review has a few integer fields > where reviewers can rate some quality of the book. How would I go > about calculating an average value for some question from all the > reviews, and display it on the book's view page? Essentially I'm > trying to show the average star rating for a book based on all the > star values in its children reviews. > > Thanks for any advice! > -Jake > > -- > You received this message because you are subscribed to the Google Groups > "Hobo Users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/hobousers?hl=en. > -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
