How do I load sub-models with a foreign key relationship in Backbone.js?
Sorry if this is a bit convoluted... I am still learning Backbone.js... What is the proper way to load & save Backbone models that have sub-models within themselves? (And should I even be having sub-models?) For example, (pardon the coffeescript), if I have something like: class Address extends Backbone.Model urlRoot: '/api/v1/address/' url: -> return @urlRoot+@id+'/?format=json' defaults: {'city': '', 'state': ''} class Person extends Backbone.Model urlRoot: '/api/v1/person/' url: -> return @urlRoot+@id+'/?format=json' defaults: { name: 'Anon', address: new Address } ... and then I do this ..