Hey everyone, I’m a newbie when it comes to Meteor and programming in general. I’m trying to create a page for users so that when they are logged in they can see the content they’ve uploaded onto the site, kind of like a profile page. I can’t seem to get the page to render. I’ve searched all over and tried stack overflow. Any ideas of where I’m going wrong?
from my publication.js file
Meteor.publish('myTickets', function() { var currentUserId = this.userId; return Tickets.find({ createdBy: currentUserId }) });
from the router.js
Router.route('/users/:_id', { name: 'userPage', waitOn: function() { return Meteor.subscribe('myTickets'); }, data: function() { return Tickets.find({ userId: Meteor.userId() }) } });
userpage.js
Template.userPage.helpers({
tickets: function() {
var currentUserId = Meteor.userId();
return Tickets.find({
createdBy: currentUserId
},
{sort: {
createdAt: -1 }
});
}
});
View
<template name="userPage">
<div class="tickets">
{{#if ownTicket}}
{{>myTickets}}
{{/if}}
{{#if nextPath}}
<a class="load-more" href="{{nextPath}}">Load More</a>
{{else}} {{#unless ready}} {{>spinner}} {{/unless}} {{/if}}
</div>
</template>
not sure why my indention’s all messed up.