Hello,
I have something strange with a piece of code.
I have interventions and each intervention is associated to a customer. Then, in my interventions list template I use:
{{pathFor 'editCustomer' customer}}
where customer is the customer _id.
If I print {{customer}} I get vFJHY2CtLi4GC7T5h but the link contains ueYXhWGL6mG3Cbq3v
ueYXhWGL6mG3Cbq3v corresponds to intervention _id
So the link is wrong beacause the id parameter is not that from the customer but the intervention
The document looks like:
{ “_id” : “ueYXhWGL6mG3Cbq3v”, “title” : “intervention#1”, “priority” : “medium”, “customer” : “vFJHY2CtLi4GC7T5h”, “assignedTo” : “97xzchCuSQGduz5vR”, “issue” : “pokpokpok”, “author” : “97xzchCuSQGduz5vR”, “createdAt” : ISODate(“2016-02-04T06:47:28.033Z”) }
My router for customer id is:
Router.route('/customers/:_id', {
name: 'editCustomer',
data: function() {
return Customers.findOne(this.params._id);
}
});
An idea ?