Ruby on rails 3 在哪里可以找到此错误消息的原因?(轨道3.2.8嵌套形式)

Ruby on rails 3 在哪里可以找到此错误消息的原因?(轨道3.2.8嵌套形式),ruby-on-rails-3,nested-attributes,Ruby On Rails 3,Nested Attributes,我的新合同格式用于工作。。。它还需要改进。。。但目前的版本可以使用,但现在我得到了以下信息: 3 errors prohibited this codeline from being saved: There were problems with the following fields: Contract can't be blank Client can't be blank Code can't be blank 我没有任何名为Contract、Client或C

我的新合同格式用于工作。。。它还需要改进。。。但目前的版本可以使用,但现在我得到了以下信息:

 3 errors prohibited this codeline from being saved:

 There were problems with the following fields:

   Contract can't be blank
   Client can't be blank
   Code can't be blank
我没有任何名为Contract、Client或Code的字段。。。那些是我的模型

以下是我在codelines_控制器中提出的参数:

{"contract_attributes"=>{"authnum"=>"900700", "st_date"=>"2012-09-03",
 "end_date"=>"2012-12-31"}, "client_attributes"=>{"f_name"=>"Esme", "mi"=>"J",
 "l_name"=>"Inneed", "birth_date"=>"1986-03-18", "address1"=>"62 Southy View",
 "address2"=>"", "city"=>"Fromm", "zip_code"=>"55803", "state"=>"WI",
 "medicare_num"=>"3008769788", "medicaid_num"=>"765894567", "member_num"=>"6709875-3",
 "soc_sec_care_mgr"=>"Caring Manager", "sscm_ph"=>"1-444-444-4444",
 "nurse_care_mgr"=>"Caring Nurse", "ncm_ph"=>"1-555-555-5555", "emer_contact"=>"Always
  Here", "ec_ph"=>"1-666-666-6666", "pri_care_phy"=>"The One", 
 "pcp_ph"=>"1-777-777-7777"}, "code_attributes"=>{"code_name"=>"S-5463",
 "status"=>"Active", "description"=>"Transition from schl to work"},
 "units_alloc"=>"100.00"}
正如您所看到的,所有需要数据的字段都有数据,并且不是“空白”

我确实签了合同,看能否请专业人士帮我设计一个按钮,为表单添加额外属性,但我不得不取消合同,因为他们没有沟通。所以这个过程的一部分需要我让他们成为github和heroku的合作者。也许他们不得不改变一些东西来完成这个项目

有人能给我一些关于如何解决这个问题的指导吗


谢谢。

在app/models/theModelThatIsUsed.rb中查找,如果您发现以下内容:

validates :contract, :presence => true
validates :client, :presence => true
validates :code, :presence => true

删除该行

您的
代码行
(?)对象可能尚未分配
合同
客户端
代码
对象。我删除了“代码”以验证(:合同id等)“代码”,并且它可以工作。。。哇,谢谢。对不起。。。你在说什么?我从我的codeline.rb模型中删除了一个validates(:contract\u id,:client\u id,:code\u id),现在我的表单工作了。。。谢谢