Forum: Ruby on Rails need help with list boxes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
(Guest)
on 2007-07-28 02:20
(Received via mailing list)
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 :

  <select name="group_name">
            <% for supplier in @suppliers %>
            <option value="<%= supplier %>" > <%= supplier %> </
option>
        <% end %>
  </select>

  <br><p><input type="submit" value="Submit"/>


Any help would really be appreciated
thanks a lot,
Czar
This topic is locked and can not be replied to.