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 <collinsj@seattleu.edu> wrote:
misiek wrote:
> I got for now this code html
>
> <select name="visible">
> <option value="1" selected="selected">Yes</option>
> <option value="0">No</option>
> </select> display
>
> I need to transfer this code to ruby
> some like =>
>
> <%= select("property", "location_id",Location.find(:all, :conditions
> => "name != '' ").collect {|p| [p.name, p.id]}, { :include_blank =>
> 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 ?
>