Here is the (Partial) code in the _form.html.erb:
---code fragment---
<%= form_for(@order) do |f| %>
  <% if @order.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@order.errors.count, "error") %> prohibited this
order from being saved:</h2>

      <ul>
      <% @order.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">

    <%= select_tag(:Client,
options_from_collection_for_select(Client.all, :id, :Company_Name))%>
  </div>
---end code fragment---

This is the error:
---server log ----
 Parameters: {"utf8"=>"✓",
"authenticity_token"=>"crNdvzlzzYskmxgmITfYMLHoR49/xYFmZ8NGhK/SwOk=",
"Client_ID"=>"2", "order"=>{"Product_ID"=>"1", "Flats"=>"100",
"Order_date(1i)"=>"2010", "Order_date(2i)"=>"11",
"Order_date(3i)"=>"16", "Due_date(1i)"=>"2010", "Due_date(2i)"=>"11",
"Due_date(3i)"=>"16", "Ship_date(1i)"=>"2010", "Ship_date(2i)"=>"11",
"Ship_date(3i)"=>"16", "Status"=>"P"}, "commit"=>"Update Order",
"id"=>"2"}
----end server log---

Note that the variable "Client_ID"=>"2" is not inside the update order
string, so, the value is not saved in the database table for record 2.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to