The use of the private methods #sort_column and #sort_direction in the controllers (to prevent SQL injection attacks)
The CSS class we use to indicate the current sorting column and direction (asc/desc)
(eg we might instead want to have 2 classes one for the column and one for the direction, as shown in the railscast).
(I've just created temporarily a little CSS in /assets/stylesheets/hq.scss to make the background of the column header green if it's an ascending sort, pink if descending).
This functionality for sorting by headers follows the design proposed in http://railscasts.com/episodes/228-sortable-table-columns and the first part of http://railscasts.com/episodes/240-search-sort-paginate-with-ajax. There will be commonality between this sorting for Orphans and sorting other tables, so please comment particularly on these aspects so that we can agree on their design. They are: