.build can't assign foreign key that doesn't exist yet
问题 I have the following code for creating pictures for users in my users controller: def new @user = User.new @pictures = @user.pictures.build({:placement => "front"},{:placement => "profile"}) end However, when I create a new user, it isn't automatically building pictures with placement "front" or "profile." In fact, there's no update whatsoever to pictures. The pictures model has attr_accessible :placement and in picture.rb belongs_to :user and in user.rb has_many :pictures accepts_nested