-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
accepts_nested_attributes_for
with active-model-adapter
#74
Comments
It seems to work as I want with this serializer :
It's uggly. For a clean solution, I think we have contribute to ember data to change those functions in I still don't know if it's a good idea or if there is a better way. What you think? |
Its strange that @GCorbel If Ember Data was changed to use |
probably scumbag stanley didn't think through the code all the way. keyForRelationship seems more correct. |
@bmac, yes, I think it will solve my problem. Thanks! |
Great @GCorbel. If you are still interested in contributing changing |
@bmac it makes sense. I'll try to do it tonight. |
Done! |
Hey, forgive my ignorance, how can I make this work with |
Hi,
When I save a record with association, I have this kind of params in my Rails app :
{"course_id"=>"1", "user"=>{"email"=>"rst", "contacts"=>[{"fullname"=>"rst", "phone"=>"rst", "email"=>"rst"}]}}
which is corrected.When I do something like
Subscription.new params
, it givesActiveRecord::AssociationTypeMismatch: User(#70224777299060) expected, got Hash(#70224747397500)
. Which is correct too but it can be useful to have an option to have this json{"course_id"=>"1", "user_attributes"=>{"email"=>"rst", "contacts_attributes"=>[{"fullname"=>"rst", "phone"=>"rst", "email"=>"rst"}]}}
in order to use it withaccepts_nested_attributes_for
.What you think ? I'm ready to contribute if you want.
The text was updated successfully, but these errors were encountered: