ActiveRecord's nested attributes do not allow you to provide an id when creating the nested objects. If you provide an ID, it results in an ActiveRecord::NotFound error message.
This patches ActiveRecord so that you can override that behavior by passing an
attribute named _create
when creating nested objects. This is similar to the
_destroy
behavior.
Add this line to your application's Gemfile:
gem 'active_record_nested_attribute_id_extension'
And then execute:
$ bundle
Or install it yourself as:
$ gem install active_record_nested_attribute_id_extension
The gem is available as open source under the terms of the MIT License.