On 6 Feb 2009, at 16:55, Steve Davie wrote:
> > Frederick Cheung wrote: >> On 6 Feb 2009, at 16:47, Frederick Cheung wrote: >> >>>> >>>> <% if params[:cruise_info] %> >>>> <%= collection_select :cabin_type, :cabin_type_id, >>>> CabinType.find_by_status(1).collect {|ct| ct}, :id, :name, >>>> {:selected => >>>> params[:cruise_info][:cabin_type_id]}%> >>>> <% end %> >>> >>> collection_select ignore the :selected option. >>> >> should add that this will change in 2.3 > > Thanks for the info Fred, but do you know of any convention for > handling > this kind of problem now? You could just use a regular select. Or if the cabin_type_id attribute of the corresponding model object is set to params[:cruise_info] [:cabin_type_id] then it will just work. Fred > > -- > Posted via http://www.ruby-forum.com/. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---