On Dec 15, 2:39 pm, Fresh Mix
<li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:> I can generage select-tag easily and it works fine:
>
> <%= select_tag "category",
> options_from_collection_for_select(@categories, "id",
"name"), :multiple
> => true, :include_blank => true %>
>
> But how can I make "selected" some values?
>
> @selected_categories = Array[1, 3]
>
> So id 1 and 3 should be: <option selected="selected">
Start by reading the documentation for
options_from_collection_for_select
Fred
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.