Tag: 批量赋值

“无法使用嵌套的受保护模型批量分配受保护的属性”

我有时间试图让这个嵌套模型正常工作。 我已经尝试了所有方式的复数/单数,完全删除了attr_accessible,谁知道还有什么。 restaurant.rb: # == RESTAURANT MODEL # # Table name: restaurants # # id :integer not null, primary key # name :string(255) # created_at :datetime not null # updated_at :datetime not null # class Restaurant :jobs has_many :positions accepts_nested_attributes_for :jobs, :allow_destroy => true validates :name, presence: true end job.rb: # == JOB MODEL # […]