I have an edit form where the form elements are in a partial. Everything
but one select box is being populated by the database information. There
are actuall 2 select boxes on the page and the first one populated from
the database but the second doesn''t.
Here''s the code that doesn''t populate.
-----------------------------
<%= select( ''employee'', ''priority'', {
"1 - Top" => "1", "2" => "2",
"3"
=> "3", "4" => "4", "5" =>
"5"}, :include_blank => true) %>
-----------------------------
Here is the full form code
----------------------------
<%= error_messages_for ''employee'' %>
<!--[form:employee]-->
<p><label
for="employee_active">Active</label><br/>
<select id="employee_active"
name="employee[active]"><option
value="false">False</option><option
value="true">True</option></select></p>
<p><label for="employee_first_name">First
name</label><br/>
<%= text_field ''employee'', ''first_name'' 
%></p>
<p><label for="employee_last_name">Last
name</label><br/>
<%= text_field ''employee'', ''last_name'' 
%></p>
<p><label
for="employee_department">Department</label><br/>
<%= select( ''employee'', ''department'', {
"Sales - New" => "new", "Sales -
Pre-Owned" => "preowned", "Sales - Internet" =>
"internet", "Finance" =>
"finance", "Service" => "service",
"Parts" => "parts", "Body Shop" =>
"bodyshop"}, :include_blank => true) %></p>
<p><label
for="employee_title">Title</label><br/>
<%= text_field ''employee'', ''title'' 
%></p>
<p><label for="employee_main_telephone">Main
telephone</label><br/>
<%= text_field ''employee'',
''main_telephone''  %></p>
<p><label for="employee_direct_telephone">Direct
telephone</label><br/>
<%= text_field ''employee'',
''direct_telephone''  %></p>
<p><label
for="employee_email">Email</label><br/>
<%= text_field ''employee'', ''email'' 
%></p>
<p><label for="employee_priority">Sorting
Priority</label><br />
<%= select( ''employee'', ''priority'', {
"1 - Top" => "1", "2" => "2",
"3"
=> "3", "4" => "4", "5" =>
"5"}, :include_blank => true) %></p>
<p><label
for="employee_about">About</label><br/>
<%= text_area ''employee'', ''about'' 
%></p>
<p><label for="employee_employee_photo">Employee
photo</label><br/>
<%= file_column_field ''employee'',
''employee_photo''  %>
</p>
<!--[eoform:employee]-->
------------------
The "priority" column updates just fine with the select box, it just
doesn''t populate from the db on load. The only difference between the
two select boxes on the page is the first is a varchar column while the
"priority" column is an integer.
-- 
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---