Last time I got the problem with active_admin. In tables where I have 5000+ rows of data it's work very slowly. How I can optimize it? Maybe somebody know some async load plugins for this module?
Active Admin is a framework for creating administration style interfaces. It abstracts common business application patterns to make it simple for developers to implement beautiful and elegant interfaces with very little effort.
RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data. 2022. 6,667,536. Stars.
There are a couple things you can do.
By default, Active Admin loads associations as drop-down filters on the index page. If those filters aren't being used, it helps to remove them because they instantiate every record of that model to build the drop-down.
ActiveAdmin.register Post do
remove_filter :categories
end
If your index page has columns that depend on associated records, it helps to eager-load them.
ActiveAdmin.register Post do
controller do
def scoped_collection
super.includes :author, :publisher
end
end
end
This doesn't really apply since you only have 5000 records, but if you get to the point where even a DB COUNT
of the table takes a long time, you might want to disable the count in the bottom right of the index page. (this feature was added in 0.6.1)
ActiveAdmin.register Post do
index pagination_total: false
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With