Forum: Ruby on Rails How to set the selected option for a combo box?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
csaba (Guest)
on 2009-02-14 12:13
(Received via mailing list)
        <label for="category" class="label_left">Kategorie</label>
          <% @selected_category =
           Category.find(:first, :select => "name, id", :conditions =>
["id = ?",  params['category_id']]) %>
         <% @all_categories = Category.find(:all, :order =>
'id').collect {|c| ([,])} %>
         <select name='edition[category_id]' id='category'
class='fieldStyle'  tabindex='3'>
        <%= options_for_select(@all_categories,
This topic is locked and can not be replied to.