0
votes

Versions:

  • Rails - 3.2.22.2
  • ActiveAdmin - 0.6.6
  • Ruby - 2.3.8p459

Need help in changing the default filter order for string input type in the index page sidebar filters.

Default order is Contains, Equals, StartsWith, EndsWith. Need to change this as Equals, Contains, and etcetera

Extras:

Way to do the above requirement in rails v5.2.1 is to add below lines at the end of active_admin.rb file

ActiveAdmin::Inputs::Filters::StringInput.filters.clear
ActiveAdmin::Inputs::Filters::StringInput.filter(:equals, :starts_with, :ends_with, :contains)

Thanks in advance

1

1 Answers

0
votes

After deep digging, I got the answer.

For active-admin v0.6.6, it should be like

ActiveAdmin::Inputs::FilterStringInput.filters.clear
ActiveAdmin::Inputs::FilterStringInput.filter(:equals, :starts_with, :ends_with, :contains)

Replacing Filters::StringInput to FilterStringInput will work