accepts_nested_attributes_for causing SQLException
问题 I would like to use accepts_nested_attributes_for to create an Article object that has_many Sections. class Article < ActiveRecord::Base has_many :sections, :order => "position", :dependent => :destroy belongs_to :categories accepts_nested_attributes_for :sections, :allow_destroy => true, :reject_if => lambda { |attributes| attributes['title'].blank? } validates_presence_of :name, :on => :create, :message => "An article must have a title" end class Section < ActiveRecord::Base belongs_to