On Jul 3, 12:33 am, JannaB <[email protected]> wrote:
> I am creating a multiple-selection list box with :
>
> <% form__list1 = [] %>
> <%= select_tag, options_for_select(["A","B","C","D"], selected ="A"),
> html_options = {"size" => 5, "multiple" => true}) %>
>
I'm not sure what the error that you're getting is, but there are
enough in this fragment to go around.
- select_tag shouldn't be followed by a comma; written that way, you
are calling it without arguments.
- select_tag requires the first argument to be the name of the field
- the final argument to options_for_select is positionial; the
"selected = " part is not required (nor is it meaningful). Similarly
for html_options. The only thing that both statements will accomplish
is setting local variables to the various array values.
- keys in the options array are traditionally symbols; not really a
bug, but a slightly incorrect idiom.
--Matt Jones
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---