ActiveAdmin limiting has_many association retrieval?
Hi this is my first spin with active admin, I have the two models: Patient Attributes Where a Patient has_many Attributes I created a patient resource like this: rails g active_admin:resource patient It seemed to work fine, however: the query active admin is creating: Patient Load (0.9ms) SELECT "patient".* FROM "patient" ORDER BY "patient"."id" desc LIMIT 30 OFFSET 0 Attribute Load (1878.2ms) SELECT "attributes".* FROM "attributes" The problem is with the second one, because I have about 200 000 Attributes so SELECT * "attributes" is killing my computer. I've been looking for an hour on how to limit the second query. Any help is appreciated. Thanks.
So I figured out why the query tried to select all of the attributes. ActiveAdmin tries to create a filter area, by default and retrieves all possibilities for the belongs_to association in order to create a drop down. To get around this I wrote a custom filter which excludes the attribute like: filter :name
Render plain form html from ActiveAdmin instead of full page
Customize ActiveAdmin Page based on Roles
NoMethodError error for search_methods activeadmin
rails concerns - superclass mismatch error with active_admin in gems list
How to filter by “is not” in active admin/ransack
Active Admin image upload with refile
AuthorizationAdapter in ActiveAdmin
ActiveAdmin and Rails Engine. How do you keep the path name the same?
Active admin defining scope for custom page
ActiveAdmin: Can I redirect the user to the index after they create/edit something?
Active admin and Pundit
Sortable for has_many does not sort properly
select2 remove tag_list item
Adding Numeric Range Filtering to ActiveAdmin
undefined method `destroy_user_session_path' for active admin with cancancan and sorcery
Active admin not working in production mode