Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: Showing part of an array....
Rosina Bignall
7/22/2006 4:39:00 PM
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-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Showing part of an array....
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password