i have an array
@item = [ [name1, value1] [name2, value2] [name3, value4] ] which
comes from the controller
i want to put this into a drop down menu where the item chosen goes
i also need to go back to the same form
where the same array @item is displayed but this time the item
selected ( :enter_by ) is now selected.
i don't want to use ajax
i have read and re-read, and then made a trip to the bookstore about
select, select_tag, options_for_select
i going on 3 hours sleep in 48 hours and need this badly.
this can not be soooooo complicated.
i can get the items to display, i can return the item selected but i
can not get the selected item to show if i go back to the form.
i posted what you wanted (as far as i understood you) in your last
question. select which sets the selected items for a multiple select
box.
could you have a look at it and maybe tell me, what you don't understand
or what does not fit with your request?
the only difference is, that in my example the array is hardcoded, but
you can replace it with any array you want.
i did look at your code and tested. it was not for a drop down.
i finally, finally got it to work - but i can not believe this how
ruby does it. it is extremely ugly. i know it can be done in a cleaner
fashion with ajax/rjs but i didn't want to add another level of
difficulty to it.
now i have to repeat this code about 100 times and i am dreading it.
almost 2 days to figure this out.
PLEASE, PLEASE let me know if there is a better way to do, there has
to be, unless folks just don't use drop down menus/selections anymore.
until now i was so gunho about ruby.