# Need help with list boxes

**URL:** <https://www.ruby-forum.com/t/need-help-with-list-boxes/110606>\
**Category:** Rails\
**Created:** [July 28, 2007, 12:20am UTC](https://www.ruby-forum.com/t/need-help-with-list-boxes/110606 "2007-07-28T00:20:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 28, 2007, 12:20am UTC](https://www.ruby-forum.com/t/need-help-with-list-boxes/110606/1 "2007-07-28T00:20:10Z")

</div>

Hello everybody,

I have a list box whose values i am getting from controller class.  
There is a submit button below it.when it is pressed, i always loose  
the value which was selected and once again the first value is  
displayed. I have made the use of “selected” but everytime i want the  
last value to be displayed in list box that was selected once the  
submit button is pressed.

the concern rhtml code is :

 \<% for supplier in @suppliers %\> \<%= supplier %\> \<% end %\> 

Any help would really be appreciated  
thanks a lot,  
Czar
