I'm wondering how to best display a running total using ActiveRecord
with ActiveScaffold.

I am trying to display a table of commissions for given users.  Users
belong to an account.  I know how to do a SUM method on my model, and
this works ok for one user.  I really want to be able to show a
running total across various users for a given account. It would also
be good to only do this for items that are on the page (because as the
list gets longer it will not be efficient to calculate this for all
records).

Any ideas?

The output I'm looking for is like (the balance is the running total I
owe as an owner):

cindy Jan 10, 2008 earned $10.00 $10.00
cindy Jan 11, 2008 earned $12.00 $22.00
tom   Jan 11, 2008 earned $10.00  $32.00
kyle  Jan 12, 2008 earned $12.00  $44.00


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to