What's the right way to do counts in Rails?

I have a rails app with many following pieces of code:

Our active community of <%= Account.find_all_by_admin(false).count %>

My question is is this the right way to do counts on views? It seems so "dirty" is there a more railish, way to do counts? I'm thinking named scopes perhaps, but I just want to be sure that these type of things won't have a greater impact in performance.

Thank You,

7
задан Simone Carletti 14 December 2010 в 13:55
поделиться