On Jul 21, 9:43 am, Joachim Cheng <[email protected]> wrote: > Hi, I am beginner RoR. I need your advanced programming... > > @rollresults = RollResult.where(:banker_id =>'3')
So you want to group your results by roll_no ? Fred > ---------------------------- > | banker_id | roll_no | > ---------------------------- > | 3 | 332 | > ---------------------------- > | 3 | 512 | <-- when roll_no match '512' > ---------------------------- > | 3 | 332 | -| > ---------------------------- > | 3 | 512 | > listing them 3 times > ---------------------------- > | 3 | 512 | -| > ---------------------------- > | 3 | 332 | > ---------------------------- > | 3 | 332 | > ---------------------------- > | 3 | 512 | <-- when roll_no match '512' > ---------------------------- > | 3 | 264 | -| > ---------------------------- > | 3 | 332 | > listing them 3 times > ---------------------------- > | 3 | 666 | -| > ---------------------------- > > The output I want as below: > ---------------------------- > | banker_id | roll_no | > ---------------------------- > | 3 | 332 | > ---------------------------- > | 3 | 512 | > ---------------------------- > | 3 | 512 | > ---------------------------- > > ---------------------------- > | 3 | 264 | > ---------------------------- > | 3 | 332 | > ---------------------------- > | 3 | 666 | > ---------------------------- > > Please help me... > > -- > Posted viahttp://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.

