The profile view of the user logged-in works well. However, i’m having problems in creating the user profile view for the other users.
I have separate Discover page where it displays all of the users that exists on the Mongo Collection and I want to be to view the person’s profile when I click on their link. However, it just shows the user logged in information on the profile page instead of the person’s I clicked.
<template name="discover">
{{#if currentUser}}
<div class="container">
<h1> Discover </h1>
</div>
<div class="discover-content">
{{#each users}}
<li>
<img src="/defaultProfilePhoto.png" class="profile-img" >
<a href="profile"> {{username}} </a> <br>
{{profile.fullName}} <br>
{{profile.gender}}, {{profile.age}}
</li>>
{{/each}}
</div>
{{else}}
{{/if}}
</template>
Template.discover.helpers({
users: function() {
return Meteor.users.find().fetch();
},
});