Ruby on Rails collection_select display attribute
Posted
by New2rails
on Stack Overflow
See other posts from Stack Overflow
or by New2rails
Published on 2009-12-20T16:38:45Z
Indexed on
2010/05/05
7:18 UTC
Read the original article
Hit count: 241
ruby-on-rails
I'm new to Rails and am working with the collection_select method.
I have two fields I'd like to display in my select box:
first_name and last_name
So far, I can only display one or the other, not both.
Here's the code I'm working with:
collection_select(:hour,:shopper_id,@shoppers,:id,"last_name")
Thank you.
© Stack Overflow or respective owner