In my ActiveAdmin model, I have a custom area to display deleted records and several filters to search for records by specific columns.
Using filters individually or in collaboration works as expected.
Using scope is working as expected.
The problem is that using the scope apparently overrides all the filters and after selecting the scope any added filter does nothing.
Does anyone have any ideas? I want to be able to show a specific area, and then still be able to filter the results within that area.
ActiveAdmin.register Example do scope :deleted do |example| Example.only_deleted end scope :all do |example| Example.with_deleted end filter :title filter :description index do column :title column :description end end
[update]
Here is the solution I went with. I set the with_deleted scope to the model and included a filter on the side to show / hide deleted results. Not ideal, as initially deleted results are also shown, but at least all filters can be used together.
ActiveAdmin.register Example.with_deleted do filter :title filter :description filter :deleted, :as => :select, :collection => {:true => nil, :false => false } index do column :title column :description end end
source share