Topic: show the order from count

last my question, i count customers per manager and show the amount of customers.
after that, if i want to display the order of customers from counting,
i coded in view
<% for i in manager.customers.size %>
   <p><strong>customer : <%= i %></strong></p>
<% end %>

but i have the error
undefined local variable or method `manager' for #<#<Class:0x399a258>:0x399a198>

any idea?

Re: show the order from count

You need to set the "manager" variable before calling this. It all depends upon the rest of your code how you want to set it.

However, there will still be a problem after that. manager.customers.size returns an integer, not an array, so you can't iterate through it. You would just do something like this:

<p><strong>customer : <%= manager.customers.size %></strong></p>

Railscasts - Free Ruby on Rails Screencasts