iam trying to display the content of collection but its not working. The widget in to dash displayed 0 items in the collection, and the views option in the lateral nav only let to add new object to the collection. In the browser console Groups.find().fetch() returns all the groups there are in the data base. My code:
admin.js:
Admin.collections.add('Groups', {
collection: Groups,
icon: 'cubes',
columns : [
{data: "title", title: "Title"},
{data: "author()", title: "Author"}
]
});
Groups.js
Groups = new Mongo.Collection('groups');
iam trying to display the content of collection but its not working. The widget in to dash displayed 0 items in the collection, and the views option in the lateral nav only let to add new object to the collection. In the browser console Groups.find().fetch() returns all the groups there are in the data base. My code: admin.js: Admin.collections.add('Groups', { collection: Groups, icon: 'cubes', columns : [ {data: "title", title: "Title"}, {data: "author()", title: "Author"} ] }); Groups.js Groups = new Mongo.Collection('groups');
Groups.attachSchema(new SimpleSchema({
. . . );
Groups.helpers({ author: function(){ var user = Meteor.users.find().fetch(); if(user.profile.firstName && user.profile.lastName){ return user.profile.firstName + ' ' + user.profile.lastName; } else { return user.emails[0].address; } } });
Sorry for my english :D