Skip to content

Commit

Permalink
Conditionally preselect author copyright in edit form if that field i…
Browse files Browse the repository at this point in the history
…s empty
  • Loading branch information
jazairi committed Dec 9, 2024
1 parent 0fd79ab commit e5ce406
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/views/thesis/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
</div>

<%= f.association :copyright, as: :select,
selected: @thesis.copyright.present? ? @thesis.copyright.id : 2,
required: true,
collection: Copyright.display_to_author,
validate: { present: true },
Expand Down

0 comments on commit e5ce406

Please sign in to comment.