-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
I have a multiple select box that works as expected to select and save multiple options. However, when I reload the form, only the first selected option shows up in the select2 box, even though all the previously selected relationships are saved in the database.
This only happens when using AJAX - when I provide a collection instead the box works as expected.
ActiveAdmin.register Offer do
form do |f|
f.input :buyers, as: :searchable_select, ajax: true, multiple: true
end
end
ActiveAdmin.register Buyer do
searchable_select_options(scope: Buyer.all.order(last_name: :asc),
text_attribute: :name_email,
filter: lambda{|term, scope| scope.ransack(first_name_or_last_name_or_email_cont: term.downcase, phone_number_cont: (term.gsub(/\D/, '').presence || "XXX"), m: 'or' ).result})
end
Metadata
Metadata
Assignees
Labels
No labels