Skip to content

Instantly share code, notes, and snippets.

@nerdyworm
Created January 22, 2013 19:27
Show Gist options
  • Select an option

  • Save nerdyworm/4597566 to your computer and use it in GitHub Desktop.

Select an option

Save nerdyworm/4597566 to your computer and use it in GitHub Desktop.
Person = DS.Model.extend
fields: DS.belongsTo("Fields")
Fields = DS.Model.extend
goats: DS.attr("number")
serializer = Ls.JSONSerializer.create()
serializer.map Fields,
fields: embedded: 'always'
person = Person.createRecord(fields: Fields.createRecord())
person.get('store').commit()
# Sends POST /fields
# then
# Sends POST /people with the correct fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment