From: Mark Volkmann Date: 2007-01-10T00:37:46+09:00 Subject: Re: sortung a structured array on more than one criteria On Jan 9, 2007, at 8:30 AM, Josselin wrote: > I can sort an array like that : > > results = rs.sort_by{|p| p.km} > > but I tried to add a scrond sorting criteria like that : > > results = rs.sort_by{|p| p.km, p.updated_at } Try this. results = rs.sort_by { |p| [p.km, p.updated_at] } This way you're sorting arrays containing each of the sort criteria. > and I got obviously an error ... parse error, unexpected '}', > expecting tCOLON2 or '[' or '.' > > canot find the correct writing..