There''s a couple of different options you have.
options_from_collection_for_select or select, itself. You might want to go
over the API [
http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html]
to see which one suits your needs best but it looks like either of
them
will get you where you need.
RSL
On 4/4/07, Matt Ryan
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
>
> Hey all,
>
> I was just wondering how I would render the following dropdown.
>
> Contact Model
>
> def full_name
> self.Firstname + '' '' + self.Lastname
> end
>
>
> Inside the view I would like to produce a DropDown list that will have
> the Firstname + Lastname displayed with the id as the value. I have
> tried a few methods and cannot seem to find a way.
>
> Cheers
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---