In my route I have a method that tries to request a list of models from the server
model: ->
App.MyModel.find
projectId: (@modelFor \"project\").id
Bad news: right now, ember-data doesn't do anything when it gets a 404 on find(). At all. The model sits in the 'loading' state forever.
There are no non-completely-stupid options, here, in my opinion. What I would probably do as a last resort is add a notFound
attribute on my DS.Model, and instead of returning 404, return JSON with notFound
set to true
. It's painful, I know...
--- I had originally offered a solution of overriding find
in a subclass of RESTAdapter
. Then I noticed that find
DOES NOT get passed the record instance it is supposedly loading. So, no go on handling 404s by putting the record into an error state.
[NOTE: ember-data has changed dramatically since March 2013, the information in this answer may no longer be operative]