Forum: Ruby on Rails Select not providing default option

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.
Jeff J. (Guest)
on 2006-03-23 15:36
Hello all.

I am running Rails 1.0 and am having trouble with the select box. In the
API it says.

"Create a select tag and a series of contained option tags for the
provided object and method. The option currently held by the object will
be selected, provided that the object is available. See
options_for_select for the required format of the choices parameter."

and then goes on to provide a parameter

I find myself in that exact scenario (replace @post.person_id with
@area.uniface_version_id) but the value is not appearing as the default
when the page is loaded.

@area.uniface_version_id is definately populated (checked in the
breakpointer) but it isn't being set as standard for some reason
(Nothing is).

The code is


  def edit
    @area = Area.find(params[:id])
    render :partial => 'edit'


<%= select('area', 'uniface_version_id', UnifaceVersion.find_all.collect
{|uv| [, ] }, { :include_blank => true }) %>

(This was copied verbatim from the scaffold _form partial)

If anyone has any pointers that would be great.


Jeff J. (Guest)
on 2006-03-23 15:41
> and then goes on to provide a parameter

Sorry, that should read

and then goes on to provide an example

(Stupid people talking near me interrupting train of thought)
This topic is locked and can not be replied to.