Skip to content

Preventing Extra Queries on Index Pages

coreyward edited this page Jul 16, 2012 · 2 revisions

On index pages, ActiveAdmin will generate a single SELECT query for each belongs_to association on a resource in order to allow filtering based on associations.

To disable this behavior, override the default list of filters by adding filters manually:

ActiveAdmin.register Post do
  filter :id
end

Individual associations can still be filtered on, just add each of them manually to the list of filters:

ActiveAdmin.register Post do
  filter :title
  filter :author
end
Clone this wiki locally