我有2个模型。会员和调查
member.rb 如下
Class Member < ActiveRecord::Base
has_one :survey, :dependent => :destroy
accepts_nested_attributes_for :survey
attr_accessible :fname,:lname, :address, :city, :state, :zip, :email, :phone, :phone_alt, :e_contact, :e_contact_phone, :physician, :physician_phone, :chiropractor, :chiropractor_phone, :password, :password_confirmation, :remember_me, :survey_attributes
end
调查.rb如下
Class Survey < ActiveRecord::base
belongs_to :member
end
但是,每当我尝试使用收到的调查属性创建成员时
ActiveModel::MassAssignmentSecurity::Error: 无法批量分配受保护的属性:调查
我正在通过控制台对此进行测试。