Skip to content

Commit

Permalink
add comment to post after saved and before transition to post index
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwdunlop committed Oct 28, 2013
1 parent 606b39f commit c5fc3fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/assets/javascripts/controllers/commentsNewController.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ App.CommentsNewController=Ember.ObjectController.extend({
var post = this.get('controllers.post.content');
var comment = this.get('store').createRecord('comment', { post: post, text: this.get('text') });
comment.save().then(function(comment){
me.get('target').transitionTo('post.index');
//post.reload();
post.get('comments').pushObject(comment);
me.get('target').transitionTo('post');
});
}
}
Expand Down

0 comments on commit c5fc3fc

Please sign in to comment.