Ruby on rails Rails中的加载超时';s活动管理员
我正在为Rails使用ActiveAdmin(),并尝试加载我的用户模型的索引视图。以下是我的app/admin/users.rb文件中的代码:Ruby on rails Rails中的加载超时';s活动管理员,ruby-on-rails,mongoid,activeadmin,Ruby On Rails,Mongoid,Activeadmin,我正在为Rails使用ActiveAdmin(),并尝试加载我的用户模型的索引视图。以下是我的app/admin/users.rb文件中的代码: ActiveAdmin.register User do config.per_page = 10 index :pagination_total => false do end end 我启用了分页功能,但看起来它仍在尝试加载所有用户,导致超时。如何让它一次只加载几个(例如10个)用户?您可以尝试改善页面性能的几件事
ActiveAdmin.register User do
config.per_page = 10
index :pagination_total => false do
end
end
我启用了分页功能,但看起来它仍在尝试加载所有用户,导致超时。如何让它一次只加载几个(例如10个)用户?您可以尝试改善页面性能的几件事:
scope :active, show_count: false
config.filters = false #or simply specify the ones you do need
controller do
def scoped_collection
resource_class.includes(:brownies)
end
end
希望这能有所帮助。您可以尝试改善页面性能的几件事:
scope :active, show_count: false
config.filters = false #or simply specify the ones you do need
controller do
def scoped_collection
resource_class.includes(:brownies)
end
end