I have a problem accessing the data from an route.
Router.route('/view/:_id', {
name: 'locationView',
data: function() { return Locations.findOne(this.params._id); }
});
Locations
is a MongoDB Collection that i've subscribed to. I can access it via a helper method on another template without problems. It has objects like name, address etc.
<template name="locationView">
<h1>{{name}}</h1>
</template>
Application hosted on meteor.com
On the front-page you can see that the entries from Locations are accessible from other templates over helper methods. So why i can't access them via the data object from the route?
The problem was adding the objects via mongo shell. That caused the ObjectID(xxx) stuff to appear in the _id of the object.
I've added some test objects via collection method 'insert' and everything works fine!
The problem was adding the objects via mongo shell. That caused the ObjectID(xxx) stuff to appear in the _id of the object.
I've added some test objects via collection method 'insert' and everything works fine!