I'd like to be able to sort the associated records count. For example:
# form.rb
class Form
has_many :references
def reference_count
self.references.count
end
end
# reference.rb
class Reference
belongs_to :form
end
#my view
= sort_link @search, :reference_count, 'References'
Is this possible? Or being able to sort the count directly without the virtual attribute.
I'd like to be able to sort the associated records count. For example:
Is this possible? Or being able to sort the count directly without the virtual attribute.
Thanks!