Tag Archives: sorting

Sorting Collections of Model Data

In Rails, if you have a multiplicity relationship (such as has_many), how can you sort it? The answer lies in the has_many (and other multiplicity) keywords. You can specify an order attribute, and sort the collection by that field. What’s more, you can even have multiple collections of the same data, sorted differently! Continue reading

Posted in Development | Tagged , | Comments Off