From: James Edward Gray II Date: 2007-06-13T22:45:31+09:00 Subject: Re: sorting arrays within an array by the first object in... On Jun 13, 2007, at 8:39 AM, Mike Dershowitz wrote: > I have a parent array of child arrays. > > Each child array contains a set of objects. These objects are all > from > the same model. > > I know that each child array contains at least one object. I want to > sort on a field in the first object in each child array, and > arrange the > child arrays in the parent array according to that field in the first > object in the child arrays. What's the best way to do this? parent_array.sort_by { |child_array| child_array.first.field_name_here } If I understood the question correctly. James Edward Gray II