Exchange from FlowRouter to IronRouter

23 Views Asked by At

I have a little problem. Need help to exchange code fragment from FlowRouter to IronRouter. Fragment to exchange:

FlowRouter.getParam("appId");

I need this to take a id from this url make my project great again.

Routes.js this.route('usersUpdate', { path: '/users/update/:uId', template: 'usersUpdate' });

In final i`ll make something like this, but in IronRouter

Template.usersUpdate.helpers({
 getUserId () {
  return FlowRouter.getParam('uID');
 }
})

How to do this better and correct? (Sorry for bad English^^)

1

There are 1 best solutions below

0
Ricardo Pesciotta On

If I understand correctly, you want to know how to retrieve the uId parameter used in the url. If so, you retrieve like this in IronRouter:

Template.usersUpdate.helpers({
   getUserId: () => Router.current().params.uID
})