From: Max Williams Date: 2008-08-12T00:32:35+09:00 Subject: Re: Sort array by two attributes? (like sql "order by A, B") Jes炭s Gabriel y Gal叩n wrote: > Here's one way: the trick is to create an array with the fields you want > to order by in the sort_by block: > Hope this helps, > > Jesus. That's a neat trick, thanks! I actually like the first one better though as you can swap a & b around in each test to get (eg) sorted by name ascending and then a date field descending. Thanks a lot guys! max -- Posted via http://www.ruby-forum.com/.