-
Notifications
You must be signed in to change notification settings - Fork 293
Open
Labels
Description
Describe the bug
When using as: :tags, the current value is not selected.
Expected behavior
When I go to edit a record the current values for in my list should be render.
Screenshots
show(with current values)
edit(values missing)
Code
controller do
def update
committee = LegiscanModel::Committee.friendly.find(params[:id])
committee.people = LegiscanModel::Politician.where(people_id: params[:legiscan_model_committee][:people_ids])
committee.save
super
end
end
permit_params :name, :state_id, :slug, :people_ids, :committee_id
form do |f|
f.inputs do
f.input :name, input_html: { disabled: true }
f.input :slug, input_html: { disabled: true }
f.input :people_ids,
label: 'Members',
as: :tags,
collection: LegiscanModel::Politician.where(state_id: f.object.state_id).order(:last_name),
fields: [:full_name]
end
f.actions
end

