Frederick Cheung wrote in post #1012126: > On Jul 21, 11:08am, Joachim Cheng <[email protected]> wrote: >> >> > I don't understand what you mean by 'group by 3 times', but you might > want to look at group_by (method on array) or at sql's "group by" > clause > > Fred
Emm.. ok, I just want to look the loop. In the beginning, we searching the roll_no is equal to '512'. Next collecting 3 steps, roll_no = [332, 512, 512], to output. After that, we searching the roll_no also equal to '512'. Next collecting 3steps again, roll_no = [264, 332, 666], to output. Repeat the same method to find roll_no == '512', next collect 3steps and show them to output. Can you make it? Thank you. :D -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en.

