class Offer < ActiveRecord::Base
attr_accessible :name, :admin_id, :guest, :depart, :return, :adult, :kid
attr_accessible :guests_attributes, :payments_attributes
has_many :guests, :dependent => :destroy
has_many :payments, :dependent => :destroy
belongs_to :admin
accepts_nested_attributes_for :guests
accepts_nested_attributes_for :payments
end
在控制器中
class PaymentController < ApplicationController
def new
@offer=Offer.new
@guest = @offer.guests.build
@payment=@offer.payments.build
end
我在模型中添加了 guest_attributes、payments_attributes。我仍然收到此错误。谁能帮我?