Michael Williams
Michael Williams

Reputation: 13

making a user profile page in meteor

I'm fairly new to meteor and am trying to figure out how to go about creating a user profile page that can be seen by other users and edited by the owner. In my current app the packages that I'm currently using for accounts are accounts-password, useraccounts:materialize, and useraccounts:iron-routing.

I have a page set up already for the profile but can't figure out how to get the data there. I've found other "tutorials" and guides but none clearly point out what I'm aiming to accomplish.

Any help is greatly appreciated.

Upvotes: 0

Views: 329

Answers (1)

Faysal Ahmed
Faysal Ahmed

Reputation: 1542

One easy and recommended way to accomplish this task would be creating a helper for profile and then displaying those data in the blaze. the logged in user's data is published by default. what you can do is something like below

Template.templateName.helpers({
    userData : function(){ return Meteor.user() };
});

and then in the blaze use this helper

{{#with userData}}
    Name: {{profile.name}}
    ... rest of the data here.
{{/with}}

Upvotes: 2

Related Questions