From: Erwin Date: 2008-09-08T17:33:50+09:00 Subject: Re: any way to write it in one line ? On 6 sep, 21:04, Rico wrote: > On Sep 6, 7:17 pm,Erwin wrote: > > >      works =  Array.new > >      session[:cart_works].each_pair {|key, value| works << key if > > value == user_id} > > > how to initialize the works array in the bloc ? > > > thanks for your lights > > >erwin > > works = session[:cart_works].keys.select { |key| session[:cart_works] > [:key] == user_id } thanks a lot, all answers show exactly what I was looking for, ...