Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] #495

Open
antarr opened this issue Mar 10, 2024 · 0 comments
Open

[BUG] #495

antarr opened this issue Mar 10, 2024 · 0 comments
Labels

Comments

@antarr
Copy link

antarr commented Mar 10, 2024

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)

image

edit(values missing)

image

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
@antarr antarr added the bug label Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant