Select not providing default option

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

Controller:

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

View:

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

(This was copied verbatim from the scaffold _form partial)

If anyone has any pointers that would be great.

Thanks

Jeff

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs