I have:

class Company < ActiveRecord::Base
  has_many :categorizations
  has_many :categories, :through => :categorizations
  has_many :managements
  has_many :managers, :through => :managements
  has_many :tenders
  has_many :documents, :dependent => :destroy

  accepts_nested_attributes_for :managers
  accepts_nested_attributes_for :documents
  accepts_nested_attributes_for :categorizations

then the form is:

= semantic_form_for @company do |f|
  = f.input :name
= f.semantic_fields_for :manager do |manager|
  = manager.inputs :name, :fiscal_code, :city, :zip_code, :address,
:street_number, :tel, :email

when I submit the form raise the error:

unknown attribute: manager


{"utf8"=>"✓",
 "authenticity_token"=>"V5GsRKLK8cRrGuUh2Jv4DB9wSYWG8ASCxHkd0Ur3o8s=",
 "company"=>{"manager"=>{"name"=>"",
 "fiscal_code"=>"",
 "city"=>"",
 "zip_code"=>"",
 "address"=>"",
 "street_number"=>"",
 "tel"=>"",
 "email"=>""}},
 "commit"=>"Create Company"}

I think there is nothing wrong but perhaps I miss something.

-- 
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