DS.Adapter#serialize()

serialize (snapshot, options) Object Defined in addon/adapter.js:255 Proxies to the serializer's serialize method. Example app/adapters/application.js import DS from 'ember-data'; export default DS.Adapter.extend({ createRecord: function(store, type, snapshot) { var data = this.serialize(snapshot, { includeId: true }); var url = `/${type.modelName}`; // ... } }); Parameters: snapshot DS.Snapshot options Object Returns: Object serialized snapshot

Creating, Updating and Deleting

Creating, Updating and Deleting Creating Records You can create records by calling the createRecord() method on the store. store.createRecord('post', { title: 'Rails is Omakase', body: 'Lorem ipsum' }); The store object is available in controllers and routes using this.get('store'). Updating Records Making changes to Ember Data records is as simple as setting the attribute you want to change: this.get('store').findRecord('person', 1).then(function(tyrion) { // ...after the record has l

DS.JSONAPIAdapter#findMany()

findMany (store, type, ids, snapshots) Promise Inherited from DS.RESTAdapter but overwritten in addon/adapters/json-api.js:112 Parameters: store DS.Store type DS.Model ids Array snapshots Array Returns: Promise promise

DS.JSONSerializer#serializePolymorphicType()

serializePolymorphicType (snapshot, json, relationship) Defined in addon/serializers/json.js:1255 You can use this method to customize how polymorphic objects are serialized. Objects are considered to be polymorphic if { polymorphic: true } is pass as the second argument to the DS.belongsTo function. Example app/serializers/comment.js import DS from 'ember-data'; export default DS.JSONSerializer.extend({ serializePolymorphicType: function(snapshot, json, relationship) { var key = re

DS.JSONAPIAdapter#updateRecord()

updateRecord (store, type, snapshot) Promise Inherited from DS.RESTAdapter but overwritten in addon/adapters/json-api.js:140 Parameters: store DS.Store type DS.Model snapshot DS.Snapshot Returns: Promise promise

DS.JSONSerializer#serializeIntoHash()

serializeIntoHash (hash, typeClass, snapshot, options) Defined in addon/serializers/json.js:1075 You can use this method to customize how a serialized record is added to the complete JSON hash to be sent to the server. By default the JSON Serializer does not namespace the payload and just sends the raw serialized JSON object. If your server expects namespaced keys, you should consider using the RESTSerializer. Otherwise you can override this method to customize how the record is added to t

Templates.helpers.render()

render (name, context, options) Stringpublic Defined in packages/ember-htmlbars/lib/keywords/render.js:14 Calling {{render}} from within a template will insert another template that matches the provided name. The inserted template will access its properties on its own controller (rather than the controller of the parent template). If a view class with the same name exists, the view class also will be used. Note: A given controller may only be used once in your app in this manner. A singleto

Ember.computed.alias()

alias (dependentKey) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:503 Creates a new property that is an alias for another property on an object. Calls to get or set this property behave as though they were called on the original property. let Person = Ember.Object.extend({ name: 'Alex Matchneer', nomen: Ember.computed.alias('name') }); let alex = Person.create(); alex.get('nomen'); // 'Alex Matchneer' alex.get('name'); // 'Alex Matchn

Templates.helpers.each()

eachpublic Defined in packages/ember-htmlbars/lib/helpers/each.js:9 The {{#each}} helper loops over elements in a collection. It is an extension of the base Handlebars {{#each}} helper. The default behavior of {{#each}} is to yield its inner block once for every item in an array passing the item as the first block parameter. var developers = [{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }]; {{#each developers key="name" as |person|}} {{person.name}} {{! `this` is whatever it was

Templates.helpers.get()

getpublic Defined in packages/ember-htmlbars/lib/keywords/get.js:105 Available since 2.1.0 Dynamically look up a property on an object. The second argument to {{get}} should have a string value, although it can be bound. For example, these two usages are equivilent: {{person.height}} {{get person "height"}} If there were several facts about a person, the {{get}} helper can dynamically pick one: {{get person factName}} For a more complex example, this template would allow the user to switc