Activeadmin sorted by multiple columns

Is it possible to sort the activeadmin table using multiple columns?

I found an issue that says this is not possible now. But I wonder if someone has implemented such functionality?

+3
source share
1 answer

I faced the same problem. Judging by the source code, this feature is not supported.

  def sort_order(chain) params[:order] ||= active_admin_config.sort_order if params[:order] && params[:order] =~ /^([\w\_\.]+)_(desc|asc)$/ column = $1 order = $2 table = active_admin_config.resource_table_name table_column = (column =~ /\./) ? column : "#{table}.#{active_admin_config.resource_quoted_column_name(column)}" chain.reorder("#{table_column} #{order}") else chain # just return the chain end end 

But there is a solution to fix the monkeys.

+4
source

Source: https://habr.com/ru/post/1496835/


All Articles