[Rails] Re: select(object, method, choices, options = {}, html_options = {})

Enrico Teotti
Fri, 07 Jul 2006 10:23:54 -0000

> <%= select(''night'', ''place_id'' ,
Place.find_all.collect {|p| [ p.name,
> p.id ] },{:selected => @night.place_id}) %>
casting the value of place_id
:selected => @night.place_id.to_i
I get what I want. I''m not sure about the reason of this, maybe cause
I''m using two models.

--
"The only thing necessary for the triumph of evil
is for good men to do nothing"
 Edmund Burke