SortHelper2 - Multiple Table / Coumn Sorting

When working with Rails for the rewrite of our site management utility I had the need to perform sorting on multiple columns of a result set. SortHelper2 is clean and works well for one table but it doesn’t support multiple tables. I present:

SortHelper2 - Multiple Tables

Please leave a comment with any bugs/issues you find.

Todo:

  • Add Tests

3 Responses to “SortHelper2 - Multiple Table / Coumn Sorting”

  1. Andy Says:

    This is a great little thing, is there any way of getting it to sort results returned by ‘acts_as_ferret’?

  2. montana Says:

    Andy,

    I don’t think that ‘acts_as_ferret’ supports sorting in the sense that this plugin works with.

    When using Ferret (Lucene) you are looking for relevant results. The sorting of the results is determined by parameters inside of Ferret. Unlike an active record .find() there is no :order parameter which is used here. You might check this page and read up on the different properties that can be associated with fields of an active record.

  3. Andy Says:

    Thanks for this.

Leave a Reply