I am working on Rails 3.1.1.rc3 and I have 2 classes as shown below.
class Customer < ActiveRecord::Base
has_many :orders, :dependent => :destroy
accepts_nested_attributes_for :orders
end
class Order < ActiveRecord::Base
belongs_to :customer
end
In my form:
<%= form_for(@customer) do |f| %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name,:class=>'textbox' %>
</div>
<%= f.fields_for :orders do |order_form| %>
<div class="field">
<%= order_form.label :number %><br />
<%= order_form.text_field :number, :class=>'textbox' %>
</div>
<%end%>
<%end%>
When it renders, the first part of the form (for customer) shows up, but the second part (for order) doesn't. Any pointers are appreciated. Thanks.