You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. Thank you so much for a GREAT library that I've used a lot! You have saved me a lot of time.
I have an application using ruby 3.1.0, rails 6.1.5 and ActiveAdmin 2.11.1, ActiveAdmin Addons 1.9.0.
I am trying to loop through a nested association in a form and one of the inputs needed is a selected_list.
Everything renders perfectly, however, when I make a selection in one dropdown, it populates every selected_list on the form. I've removed the other fields in the form to isolate the problem:
the relationship is:
Application has_many :submissions
Submission has_many :decisions
Decisions HABTM Reasons => reasons_decisions join table
f.semantic_fields_for @submission do |fs|
fs.semantic_fields_for :decisions do |r|
r.inputs do
...
r.input :reason_ids, as: :selected_list, label: 'Reasons', display_name: :explanation, fields: [:explanation],
minimum_input_length: 0, url: admin_submission_reasons_url
end
end
end
Resulting in the following html (when there are two decisions, for example):
When I click into the search select in one input, I see that a data-select2-id gets added and then, when I click in the other search select, a unique data-select2-id gets added to that one.
And, the actual selects each have a unique id:
application_submission_decisions_attributes_0_reason_ids
application_submission_decisions_attributes_1_reason_ids
I have tried adding additional ids and classes to the inputs for uniqueness.
THANK YOU for any guidance on what I am doing wrong here. It's SO close to working, I don't want to give up!
I've tried with a search_select and do not have the same problem, but I really need the list.
The text was updated successfully, but these errors were encountered:
Hello. Thank you so much for a GREAT library that I've used a lot! You have saved me a lot of time.
I have an application using ruby 3.1.0, rails 6.1.5 and ActiveAdmin 2.11.1, ActiveAdmin Addons 1.9.0.
I am trying to loop through a nested association in a form and one of the inputs needed is a selected_list.
Everything renders perfectly, however, when I make a selection in one dropdown, it populates every selected_list on the form. I've removed the other fields in the form to isolate the problem:
the relationship is:
Application has_many :submissions
Submission has_many :decisions
Decisions HABTM Reasons => reasons_decisions join table
@submission = application.submissions.last:
Resulting in the following html (when there are two decisions, for example):
When I click into the search select in one input, I see that a data-select2-id gets added and then, when I click in the other search select, a unique data-select2-id gets added to that one.
And, the actual selects each have a unique id:
application_submission_decisions_attributes_0_reason_ids
application_submission_decisions_attributes_1_reason_ids
I have tried adding additional ids and classes to the inputs for uniqueness.
My permit params:
but something is definitely wonky with the nested params when I submit the form ( "decision"=>{"reason_ids"=>["", "", "60"]},)
THANK YOU for any guidance on what I am doing wrong here. It's SO close to working, I don't want to give up!
I've tried with a search_select and do not have the same problem, but I really need the list.
The text was updated successfully, but these errors were encountered: