Jackdan wrote:> Hi everyone,
>
> For my application I''m trying to create a drop-down with multiple
> select that has multiple values already selected. I have the values
> that I need to select in an array, but I don''t know how to tell my
> ''select'' statement how to highlight them.
>
> Here is an example of what I mean:
>
> select(''search'',
> ''user_id'',
> User.find_all.collect {|p| [ p.username, p.id ] },
> { },
> { :multiple => true, :size => 5, :name =>
''search[user_id][]''
> }) %>
>
> Now I just need to make this drop-down select all of the items that are
> in an array: ''options_to_select = [1,2,3]'' for example.
>
> Thank you for your time,
>
> Jd
Drop down selects cannot select more than one item. if you need to do
that, you need a multi-select control. Just specify :multiple=>true in
a select_tag.
_Kevin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---