I am creating an interface for administering organizations that can connect a lot of people. The total pool of people consists of several thousand people.
As far as I know, AA does not have a really good system for this kind of situation.
So far I have used something like this in the form block to add / remove people from the organization:
f.has_many :person_organizations, for: [:person_organizations, f.object.person_organizations.active] do |connection_f|
all_people = Person.select([:id, :firstname, :lastname]).order(:firstname, :lastname)
connection_f.input :person, as: :select,
collection: all_people,
member_label: proc { |d| "#{d.firstname} #{d.lastname}"
unless connection_f.object.nil?
connection_f.input :_destroy, as: :boolean, label: 'Delete this connection'
end
end
The problem is that after adding a few people to the organization, the time taken to create all the selection boxes becomes significant because it should do almost the same job for each element. See below ("slett denne koblingen" means "delete this connection")

Does anyone know how to alleviate this pain?
I had a few thoughts, but I don’t quite understand how to implement them:
, github, , , , - : https://github.com/activeadmin/activeadmin/issues/2692#issuecomment-71500513