Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

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