From: Dave Goodchild Date: 2008-09-07T03:19:55+09:00 Subject: Re: any way to write it in one line ? ------=_Part_61151_4497330.1220725553623 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline session[:cat_works].each_pair do |key, value| works = Array.new unless works works << key if value == user_id end On Sat, Sep 6, 2008 at 7:14 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 > > ------=_Part_61151_4497330.1220725553623--