Rails Collection_select names
Posted
by Jack
on Stack Overflow
See other posts from Stack Overflow
or by Jack
Published on 2010-06-12T15:27:00Z
Indexed on
2010/06/12
15:32 UTC
Read the original article
Hit count: 179
ruby-on-rails
|form
Hi,
I am creating a Rails app and have added a form:
<div class="field">
<%= f.label :title %><br />
<%= f.text_field :title %>
</div>
<div class="field">
<%= f.label :client_id %><br />
<%= collection_select(:project, :client_id, Client.all, :id, :contact_name, {:prompt => "Select a Client"}) %>
</div>
This currently displays the contact_name of the client. Is it possible to have it display a list of contact_names concatenated with the client_id? If so, how would I do this?
Cheers
© Stack Overflow or respective owner