I have this each loop:
<% User.group(:team).count.each do |team, count| %>
<%= "The '#{team}' has '#{count} User'" %>
<% end %>
The output is like this:
The 'Vikings' has '1 User' The
'Redsocks' has '3 User' The 'Giants' has '1 User' The
'Milan' has '2 User' The 'IKS' has '1 User' The 'Clampers' has '1 User'
I want count to be added together, and team to be added together. I want the output be something like:
the app has " 9 " users supporting "6 " different teams
Can someone advise me on how to do that?