i have a simple post route that looks for the post _id
.
The problem is that the pathFor
helper creates a path like this:
ObjectID("52e16453431fc2fba4b6d6a8")
I guess the mongoDB insertion as been changed and now the _id
object holds another object inside it called _str
.
Here is my route:
this.route("post", {
path: "/post/:_id",
waitOn:function(){
NProgress.start();
Meteor.subscribe("Teams");
},
before: function () {
NProgress.done();
},
data: function () {
return Posts.findOne({_id: this.params._id});
}
});
Currently, it creates an href
like :
post/ObjectID("52e16453431fc2fba4b6d6a8")
clicking on it opens a url
post/ObjectID("52e16453431fc2fba4b6d6a8")
However, I get the "NotFound" template instead of the post.
How can I fix this?