Skip to content

Instantly share code, notes, and snippets.

@pierot
Created January 25, 2011 08:33
Show Gist options
  • Select an option

  • Save pierot/794664 to your computer and use it in GitHub Desktop.

Select an option

Save pierot/794664 to your computer and use it in GitHub Desktop.
Rails 3 accepts_nested_attributes_for
class Album < ActiveRecord::Base
has_many :content, :dependent => :destroy
accepts_nested_attributes_for :content, :allow_destroy => true
end
class Content < ActiveRecord::Base
belongs_to :album
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment