Hello, I'm starting out with Ruby On Rails, and I'm making an application that manages expenses. Well what I need to do add up all the expenses of the "value" column and show in the view.
I'm trying the following in ActiveRecord
def total
divida.sum("valor * ")
end
Would that be the right way? How do I show it in the view?
Thank you for your attention!