Skip to content
This repository was archived by the owner on Dec 12, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Running the generator will add a file at <tt>public/javascripts/nested_form.js</

== Usage

Imagine you have a <tt>Project</tt> model that <tt>has_many :tasks</tt>. To be able to use this gem, you'll need to add <tt>accepts_nested_attributes_for :tasks</tt> to your Project model. If you don't have the <tt>accepts_nested_attributes_for :tasks</tt> you'll get a Missing Block Error.
Imagine you have a <tt>Project</tt> model that <tt>has_many :tasks</tt>. To be able to use this gem, you'll need to add <tt>accepts_nested_attributes_for :tasks</tt> to your Project model. If you wish to allow the nested objects to be destroyed, then add the <tt>:allow_destroy => true</tt> option to that declaration. If you don't have the <tt>accepts_nested_attributes_for :tasks</tt> you'll get a Missing Block Error. See the {accepts_nested_attributes_for documentation}[http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html#method-i-accepts_nested_attributes_for] for details on all available options.

This will create a <tt>tasks_attributes=</tt> method, so you may need to add it to the <tt>attr_accessible</tt> array. (<tt>attr_accessible :tasks_attributes</tt>)

Expand Down