Questions tagged [ember-data]

ember-data is a data persistence extension for the Ember.js framework.

Because the MVC framework builds applications which run in the browser rather than returning fully-rendered pages in response to browser requests, it requires a method for saving and reloading user data.

Ember.js supports a number of "data persistence" libraries, including a data store component inherited from the framework. In general these frameworks support CRUD operations on a RESTful web service, and as such they are agnostic regarding the technology of the back-end web service.

Ember-data is the "official" data persistence library for Ember.js, supported by the Ember.js team. It uses "adapters" to load data for use by Ember.js applications, and allows developers to write custom adapters to support their own specific data store.

Beta Period

During the beta period (up until 1.0) the API is constantly changing, you can keep up to date by reading the Transition Document.

Getting help

Ember-data is supported in much the same way as Ember.js itself.

The Stack Overflow tag is actively monitored by several contributors to Ember. You may try asking questions in the active IRC channel #emberjs on irc.freenode.net. Other resources can found on the Ember.js community page

Technical questions that are accompanied by working code make it easier for other to help give good answers. JSFiddle | JSBin

To report bugs against Ember.js, or to propose new functionality, create an issue on the Github project.

5483 questions
2
votes
1 answer

commit() for a single object

The following save function commits the whole store. How can I commit just this? this.commit(); doesn't work. app.js App.UserController = Ember.ObjectController.extend({ save: function() { this.get('store').commit(); } })
wintermeyer
  • 8,178
  • 8
  • 39
  • 85
2
votes
1 answer

How do I resolve a model class from a String name in Ember data?

I'm trying to use ember-data, and I need to be able to dynamically resolve a model name given a String. I looked into the ember-data codebase, but couldn't find anything there. Then I found this in ember: /** @private This function defines the…
2
votes
1 answer

Ember Router transitionTo nested route with params

App.Router.map(function() { this.resource('documents', { path: '/documents' }, function() { this.route('edit', { path: ':document_id/edit' }); }); this.resource('documentsFiltered', { path: '/documents/:type_id' }, function() { …
Everydaypanos
  • 165
  • 1
  • 13
2
votes
2 answers

Collection of objects of multiple models as the iterable content in a template in Ember.js

I am trying to build a blog application with Ember. I have models for different types of post - article, bookmark, photo. I want to display a stream of the content created by the user for which I would need a collection of objects of all these…
Guruprasad
  • 1,447
  • 4
  • 16
  • 34
2
votes
1 answer

Everytime I click on link in Ember app, the associated model appends same data to the page

Here is my Ember code: http://pastebin.com/Hb9HCyy6 Here is html: http://pastebin.com/kp195dFA JSFiddle: http://jsfiddle.net/MBmUs/270/ Now even that stopped working lol I put that API online, when I access it with browser it works. App.Store =…
galdikas
  • 1,609
  • 5
  • 19
  • 43
2
votes
1 answer

Modelling a nested json structure

I have the following json data: { "type": "type1", "name": "Name1", "properties": { "age": 23, "address": "Sample" } } I am modelling this with Ember Data, as follows: App.Node = DS.Model.extend({ type:…
blueFast
  • 41,341
  • 63
  • 198
  • 344
2
votes
1 answer

Ember.js: Setting a computed property based on all elements in a Fixture

I am building a simple data visualization that shows the share of device type based on the total number of records. I am wondering if there is a way to compute a property based on all elements in the Fixture. App.Devices = DS.Model.extend({ …
Evan Price
  • 33
  • 4
2
votes
2 answers

Tristate checkbox in ember

I have to implement a tristate checkbox in ember quickly so I was wondering if someone can give me a pointer to an implementation of tristate checkbox in ember?
Swapnil
  • 265
  • 5
  • 10
2
votes
1 answer

Ember.js data - basic adapter does not implement findAll method?

With the basic adapter App.Store = DS.Store.extend({ revision: 12, adapter: 'DS.BasicAdapter' }); I have: 'Uncaught Adapter is either null or does not implement findAll method'. And indeed there is no findAll method in the basicAdapter…
Geekingfrog
  • 191
  • 1
  • 8
2
votes
2 answers

How can I upgrade ember-rails' version of ember-data to revision 12?

I've got ember-rails updated to master: bundle update ember-rails Updating git://github.com/emberjs/ember-rails.git Fetching gem metadata from https://rubygems.org/......... .... Using ember-rails (0.11.1) from…
benburton
  • 153
  • 7
2
votes
1 answer

Save foreign key to other Model with hasMany relation

I'm having the following problem. In my app I have a screen to make a new Site. But when I save the new site via an action on the controller, the languages-property isn't sent with the POST-request to the server. The template for adding a new Site…
Willem de Wit
  • 8,604
  • 9
  • 57
  • 90
2
votes
1 answer

One Observer called multiple times in emberjs

I actually play around with ember js and I'm confused, about the observer behavior. App.ProjectView = Ember.View.extend({ modelChanged: function() { console.log('modelChanged to: '); …
conscience
  • 463
  • 6
  • 21
2
votes
1 answer

What should an ember-data REST server API return?

I'm having weird update errors on some routes so I just wanted to sure that it wasn't something fundamental at this level. At the moment I do this: Create POST /plural 201 {"singular": {"id":"1", ...}} FindAll GET /plural …
Sambeau
  • 245
  • 1
  • 3
  • 12
2
votes
1 answer

Ember Data, Relationships, output of attribute

I have two entities with fixtures data: User and Role. When I load a User, it contains one Role. I would like to show the name of the role. Here is relevant code: App.User = DS.Model.extend({ name: DS.attr('string'), role:…
Misha
  • 828
  • 10
  • 23
2
votes
1 answer

How to reload data every x seconds?

I'd like to pull a set of data every couple of seconds (no need to discuss the pros and cons of pull vs. push here). As far as I understand ember-data that should be done with reload. Here is my app.js in which I try to trigger the pull in a ready…
wintermeyer
  • 8,178
  • 8
  • 39
  • 85