Closed evo2013 closed 9 years ago
First look at this PR: https://github.com/AgileVentures/osra/pull/384/files It has the sorting done for the Sponsors table with helper methods that can be used for other Models also. Once this is merged feel free to apply it to Partners.
Sorting on a model relation is done using the joins
method:
Partner.joins(:province).order("provinces.name desc")
But it would be better to use the scope :column_sort
and refactor it to also accept relations.
Instead of the up/down arrows, better use the glyphicons from bootstrap. See the sponsors sorting PR, it has 2 css classes that be added to a span
element.
Cristian, I just checked this email account yesterday and got your message. Thanks for the feedback. I'll follow up on your recommendations and should have a new PR into OSRA by the weekend.
OSRA-419: 1) Implemented sortable headers . Last column Province is sorting by province_id not province name. Province name does not exist in Partner's model & calling a separate tabel throws error. Your comments? 2) Implemented up/down arrows for sorting but partners view is not picking up assets/images .gif files. Your comments? 3) Working on adding sort tests.