Hi,
I am filling a collection_select with a list of models references based
on a column named “model_ref”.
<%= collection_select(:assets, :model_id, @models, :id,
:model_ref,:prompt => ‘- Select a model -’) %>
I have two issues :
-
I would like to concatenate another column next to the model
reference inside the option value with the description of this model
reference.
I’ve tried :
<%= collection_select(:assets, :model_id, @models, :id, {:model_ref
:description}, :prompt => ‘- Select a model -’) %>
But it doesn’t work, the text_method of collection_select doesn’t seams
to support two columns.
Any idea I can do that ? -
The “:prompt =>’-Select a model-’” doesn’t work.
I’ve tried as the rails API suggest
“options={:prompt => ‘- Select a model -’}”
Same problem.