Forum: Ruby on Rails How to populate form dropdown with 2nd item of model

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.
ChrisYo (Guest)
on 2009-03-06 12:33
(Received via mailing list)
I'm trying to create a dropdown list that's populated from a model but
which has the 2nd item in the model as the default selection.  This is

Here's the model snippet.
  PROPERTY_TYPES = [['Choose',           ''],
                   ['Residential',       'Residential'],
                   ['Commercial',        'Commercial']]

Here's the form snippet
<%= :property_type, Lead::PROPERTY_TYPES, :style => 'width:
100px;' %>

Is there a way to have the form default to "Residential" but still
allow the user to select either?

This topic is locked and can not be replied to.