Backbone Model.save does not transfer model state to a nested object. This is normal?
A typical Rails script is something like this [: product] parameter. How could I achieve this?
This was mentioned earlier: Saving nested objects using Rails, backbone.js and accepts_nested_attributes_for
I would suggest overriding JSON on the base model.
toJSON: function(){ json = {car : this.attributes}; return _.extend(json, {engine_attributes: this.get("engine").toJSON()); }
toJSON is called inside the synchronization method immediately before sending data to the server.
Source: https://habr.com/ru/post/888620/More articles:How to change background color of focal view - androidWhat is the best hosting provider for MongoDB for Windows? - mongodbThumb rules for placing functions in header files - c ++Inclusion of external documentation in a Sphinx project - pythoniPhone: Selecting a file from a location to upload to the server - objective-cHow can I make a regex that takes into account accented characters? - javascriptAS3 RegExp for matching words with border type characters - flexHow do backbonejs models handle server-side errors? - backbone.jsMissing ADO.net Entity framework template in VS 2010 SP1 - visual-studio-2010An elegant way to implement call multiplexing in an aggregate C ++ class? - c ++All Articles