From: Rico Date: 2008-09-07T03:59:01+09:00 Subject: Re: any way to write it in one line ? 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 }