Hi, stuck with another little problem, select lists / drop down boxes.
Tried to avoid these because the code looks uber scary.
Anyway I’ve created a Hash Array called gender:
@gender = [‘Man’ => ‘male’, ‘Woman’ => ‘female’]
here you’ve got the key (being the english name) and the value (the
generic equivalent).
what I want to do is make a drop-down single-selection box use these
key/value properties to render it correctly,
<%= select(“search”, “type”, @gender) %>
…this doesn’t work but what i’d like is generate the form code…
Man WomanI’d then read the value off the form via:
@selection = params[:search]
Where am I going wrong?, I know i need some kind of {key, value} clause
in the select() control but unsure where.
Any help really appreciated,
Sincerely
John.