Created
January 28, 2018 21:53
-
-
Save sirramongabriel/8df729e14c72ebd11f294f8fd8a27ef3 to your computer and use it in GitHub Desktop.
Display attempts to retain value of select when commit or patched
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--I've tried the following --> | |
<%= f.collection_select( | |
:doctor_full_name, | |
@resident.doctors, | |
:full_name, | |
:full_name, | |
{ selected: f.object.doctor_full_name, prompt: true } | |
) %> | |
<%= f.select( | |
:doctor_full_name, | |
resident.doctors.map(&:full_name), | |
selected: f.object.doctor_full_name, | |
prompt: true | |
) %> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment