When I click on user's name, I want the link to go to their profile page. I am using Meteor with iron router. Here are the defined routes:
Router.route('/', { name: 'JobsList'}); //homepage with all users
//this is where the user's profile is located and works:
Router.route('/company/:_id/', {
name: 'CompanyPage',
data: function() { return Meteor.users.findOne(this.params._id); }
});
//this page shows all users with url that works:
Router.route('/companies/', {name: 'CompaniesList'});
I get the incorrect link when I hover over the user's name on the homepage but I get the correct link when I hover their name on the '/companies/' page. In order to generate the link, I use pathFor "CompanyPage"
.
Am I missing something that is causing the incorrect url from the homepage? What js or html you need to have a look at? Let me know and I'll edit this post. Thanks.