leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
537 stars 215 forks source link

What is the easiest way to sort by association count? #247

Closed tboyko closed 8 years ago

tboyko commented 8 years ago

If I have an object Newspaper with a has_many associated object Article, what is the easiest way to make a table column sortable based on the number of articles the newspaper is associated with?

leikind commented 8 years ago

Store this value in a column. Or try to use this http://wicegrid.herokuapp.com/custom_ordering