0

I have column on index page in ActiveAdmin:

column("Credit amount", sortable: true) {|u| u.credit_amount.format }

I'm using gem money-rails for :credit_amount and .format method on index page for readability.

But sorting doesn't work. How can I make sorting from largest to smallest and vice versa for this column?

SsPay
  • 177
  • 1
  • 10

1 Answers1

2

Try this

column("Credit amount", sortable: 'products.credit_amount_cents') {|u| u.credit_amount.format }

Just make sure to replace products with whatever table name you have.

DNNX
  • 6,215
  • 2
  • 27
  • 33