Organizational Research By

Surprising Reserch Topic

Question:How to build a link without preloading the model?


Right now, we're building our links like that:

 {{action showComment comment href=true}}>Show

That generates a link which looks like /comments/45.

Unfortunately, that only works when we preload the comment - even though we already have the ID of the comment. Is it possible without preloading the comment?

Something that might look like:

 {{action showComment comment_id href=true}}>Show

 


asked Sep 13, 2013 in Java Interview Questions by rajesh
edited Sep 12, 2013
0 votes
30 views



Related Hot Questions

2 Answers

0 votes
What is the actual question here? This is not quite clear to me.

So your current action handler looks like this:

showComment : function(comment){
  //do your stuff with the model
}

Now your desired solution could look like this:

Show

And the corresponding handler:

showCommentById : function(commentId){
  var comment = App.Comment.findById(commentId); // i assume you have this retrieval method or something like it
  this.showComment(comment);
},
showComment : function(comment){
  //do your stuff with the model
}

Would this work in your case? Or did you intend something else?
answered Sep 13, 2013 by rajesh
edited Sep 12, 2013
0 votes
What is the actual question here? This is not quite clear to me.

So your current action handler looks like this:

showComment : function(comment){
  //do your stuff with the model
}

Now your desired solution could look like this:

Show

And the corresponding handler:

showCommentById : function(commentId){
  var comment = App.Comment.findById(commentId); // i assume you have this retrieval method or something like it
  this.showComment(comment);
},
showComment : function(comment){
  //do your stuff with the model
}

Would this work in your case? Or did you intend something else?
answered Sep 13, 2013 by rajesh
edited Sep 12, 2013

...