jeudi 26 février 2015

LSAdapter with ember-rails

I am reading the book of Ember in action but trying to write the code with ember-rails.


In the first chapter I didn't arrange to use the LSAdapter. When I checked Network of Ember Inspector, it seem like it is calling the api (exactly to /notes). My code is like:



# routes/notes.js.coffee
Notes.NotesRoute = Ember.Route.extend
model: -> @store.find 'note'

# store.js.coffee
Notes.ApplicationStore = DS.Store.extend
adapter: DS.LSAdapter # specify to use Local Storage Adapter

# router.js.coffee
Notes.Router.map ()->
@resource 'notes', path: '/', ->
@route 'note', path: '/notes/:id'


Am I doing something wrong? Any suggestion will be appreciated. The error I see in the console is:


enter image description here





Aucun commentaire:

Enregistrer un commentaire