Meteor novice-- display list of user emails

Hi all, I’m new to Meteor (and any kind of back-end in general), and I’m having some trouble displaying a list of registered users. Right now it’s coming back blank, but with the correct number of rows in the table. Here’s the html:

<template name="users">

      {{#each users}}
        {{> user}}

<template name="user">

The publish:

Meteor.publish('users', function() {
  return Meteor.users.find({}, {fields:{emails:1}});

The subscribe:


The helper:

  users: function(){ return Meteor.users.find(); },
  userEmail: function() {  return this.emails[0].address; },

I’m not having any trouble with other collections, but maybe I’m missing something with the users collection. Since the table has the correct number of rows, it appears that the publish/subscribe is going through correctly.

Thanks in advance for the help.

You defined the userEmail helper in the users template, but you’re accessing it in the user (singular) template.

  users: function(){ return Meteor.users.find(); },
   // move this line to Template.user.helpers
  // userEmail: function() {  return this.emails[0].address; },
1 Like

Thanks! That worked. So simple, I should have seen it.