Another try with a collect problem

Trying to figure out how to indicated ‘selected’ value in multi-valued
collect…

<%= select ‘counseling_note’, ‘fi_facility_id’, [[‘Select Facility’,
‘’ ] ] + @facilities.sort { |a,b| a.name <=> b.name }.collect { |fac|
[fac.name, fac.id] }, :selected => @fi_facility_id %>

but the :selected => doesn’t work

I can provide it either/both fac.name and fac.id but no matter what I
do, I can’t get the select list to display the currently selected
value.

Any suggestions?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs