[Rails] Re: matching roll_no then loop 3 times, next loop..
Frederick Cheung wrote in post #1012126:
> On Jul 21, 11:08am, Joachim Cheng <li...@ruby-forum.com> 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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home