0

I'm trying to add sorting to my activscaffold. Example code is:

active_scaffold :user do |config|
config.columns = [:id, :name, :rating]
config.list.per_page = 25
config.columns[:rating].sort = true

But when i check column 'RATING' isn't sortable.

Alex Todef
  • 370
  • 2
  • 7

2 Answers2

0

try this

list.sorting = {:rating => 'ASC'}

Edson
  • 31
  • 3
0

Add this method to your controller

def custom_finder_options
  {reorder: 'rating ASC'}
end
MyroslavN
  • 1,701
  • 1
  • 12
  • 6