How to update record


#1

I have a list of items, so when I link to a item I want to show all the UPDATED information of that item:

App.ItemsRoute = Ember.Route.extend({
  model : function(){
    return this.store.find('item');
  }
});

App.ItemRoute = Ember.Route.extend({
  model : function(params){
    return this.store.update('item', { id : params.id});
  }
});

But this isn’t triggered, how can I achieve this?


#2

Solved:

 App.ItemRoute = Ember.Route.extend({
    model: function(params){
      return this.store.find('item', params.id);
    },
    setupController: function(controller, model){
      controller.set('model',model);
      controller.get('model').reload();
    }    
});

This worked for me,