From: Justin Bailey Date: 2006-02-25T09:10:08+09:00 Subject: Re: select() ------=_Part_21094_19054533.1140826193166 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Go to http://api.rubyonrails.com/ and click on the Method named "collection_select". It does just what you want. On 2/24/06, Justin Collins wrote: > > misiek wrote: > > I got for now this code html > > > > display > > > > I need to transfer this code to ruby > > some like =3D> > > > > <%=3D select("property", "location_id",Location.find(:all, :conditions > > =3D> "name !=3D '' ").collect {|p| [p.name, p.id]}, { :include_blank = =3D> > > false }) %> > > > > function above look for from database some data and put it into the > > drop box fields > > I need display only YES and NO and set them values 0 and 1 > > > > any ideas ? > > > > Have you looked at erb > (http://ruby-doc.org/stdlib/libdoc/erb/rdoc/index.html) or the CGI > standard library (http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html)? > > Or do you mean parsing the HTML and making into that code? > > -Justin > > ------=_Part_21094_19054533.1140826193166--