Skip to content

Commit

Permalink
Default Person field in Role Appointments to empty
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjam committed Nov 14, 2023
1 parent a92d176 commit 7b12232
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/views/admin/role_appointments/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
label: "Person (required)",
heading_size: "l",
name: "role_appointment[person_id]",
options:
disambiguated_people_names.map { |person_name, person_id|
options: (
[{ text: "", value: "", selected: false }] +
disambiguated_people_names.map do |person_name, person_id|
{
text: person_name,
value: person_id,
selected: form.object.person_id == person_id,
}
}.select do |option|
form.object.new_record? || option[:selected]
end,
end
).select do |option|
form.object.new_record? || option[:selected]
end,
error_message: errors_for_input(form.object.errors, :person_id),
} %>

Expand Down

0 comments on commit 7b12232

Please sign in to comment.