In the first one, the child is saved right away. In the second, the child is not saved until the parent is saved
You may find this usefull: http://blog.mrbrdo.net/2009/10/27/ruby-on-rails-new-vs-create-vs-build/ On Apr 23, 9:38 am, Manoj Kumar <[email protected]> wrote: > What is the difference between > > parent.children << child.new > > and > > parent.children.build(params[:child]) > -- > Posted viahttp://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

