From: Rosina Bignall Date: 2006-07-23T01:39:26+09:00 Subject: Re: Showing part of an array.... unknown wrote: > Rosina, > > I'll explain this line: > > colors[0..2].collect{ |color| color.name }.join(', ') > > Thank you for the explanation! That helped me understand what's going on in the collect better. Yes, name is defined. This is actually from a rails app and colors is the table which has a name attribute (among others), so this line works great if I want to show all the colors. In another post a few minutes ago, I explained how I am actually using this in a call to another function from in ajax_scaffold. I was trying to simplify it somewhat to get at the core of the problem, but I think in my lack of understanding, I simplified too much Cheers, Rosina -- Posted via http://www.ruby-forum.com/.