------art_11859_3812602.1189453411264
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

that's just what I was looking for. thanks the both of you

Dante

On 9/10/07, Phlip <phlip2005 / gmail.com> wrote:
>
> Dante Regis wrote:
>
> > It was something like   [0, 1, 2].each {  } , with some char inside the
> > brackets, like &, but I can't remember it. anyone knows how to use it?
>
> If I guess correctly, ActiveSupport has a cute little tweak that permits
> this:
>
> p (0..10).to_a.map(&:to_s)
>
> Any place you can write {|x| x.y}, you can shorten that to (&:y). This
> works
> great with ActiveRecord, to convert a list of database records into a list
> of one of its fields:
>
> p User.find(:all).map(&:name)
>
> --
>   Phlip
>
>
>

------art_11859_3812602.1189453411264--