Ruby on Rails
Saturday, November 7, 2015
In my application I have a drop-down, I want to input a value in a text-field and while inputting it the drop-down should display the option for auto-completing it. Following is the code snippet
<div class="field">
<%= f.label :patient_id %><br>
<%= f.collection_select(:patient_id, Patient.all, :id, :patient_identity, {:prompt => "Select patient"}, :selected => @vital.patient_id, required: true) %>
</div>
<%= f.label :patient_id %><br>
<%= f.collection_select(:patient_id, Patient.all, :id, :patient_identity, {:prompt => "Select patient"}, :selected => @vital.patient_id, required: true) %>
</div>
--
Cheers!
Deepak Kumar Sharma
Guru Nanak Dev Engineering College
India!
Blog: http://deekysharma.wordpress.com
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALDHwN6AtoMSH3qGd84zrFhyEFZjqNTo9jF89P6MKoGGuX6swQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment