I'm having a really hard time getting backbone-relational to work correctly.
The problem is simple to understand (now I've tracked it down):
- on save of the parentmodel NEW child models are created
- from that point forward childviews that were bound to existing child models, keep referencing these child models which are now orphaned.
- from then forward every change from a child view gets populated to it's corresponding orphaned model, which of course doesn't cascade to the parent model anymore.
Of course I want the childviews to link to the active childmodel instead of the orphaned one. I could go hacking something together that on each save, rebinds the views to the newly created models, but this seems such a normal use-case that I feel I must be missing something completely trivial.
How on earth do I just keep these childviews bound automatically to the correct childmodels?
(as an aside, it looks completely unnecessary to me for backbone-relational to be making new childmodels on save to begin with (instead of updating the existing ones). Without this, all would be working normally.. pfff)