I have a template where I represent a User which hasMany usertags. The values are there after I hit F5, I'm not sure how to automatically refresh the view. I've looked into the ember observer, but it only fires after the DOM load - anyway I'm not sure if observers are the answer yet so looking for a fresh opinion on how to do this.
{{username}}
<span {{action 'addusertag' selectedTag}}>Add</span>
{{#each tag in model.usertags}}
{{/each}}
App.UserRoute = Ember.Route.extend({
setupController: function(controller, model) {
this.controller.set('model', this.get('store').find('user',model.id));
},
actions: {
addusertag: function(params){
var tag = this.get('store').createRecord('usertag', {tag_id: params.id, user_id: this.currentModel.id});
tag.save();
}
}
});
Thanks!