0

I currently have the below route and it works great. I want to change the path that is being used to a different id that is inside the same document (not a mongoDB generated id). How can I change this route to use a different id in the path?

this.route('thanks', {
      path: ':root/thanks/:_id',
      waitOn: function() { 
        return Meteor.subscribe('donate', this.params._id)},
      data: function () {
        var root = Meteor.settings.root;
      return Donate.findOne(this.params._id);
          },
      action: function () {
          if (this.ready())
              this.render();
          else
              this.render('Loading');
      }
  });

In my client side code I do this to return the page.

Router.go('/give/thanks/' + result);

JoshJoe
  • 1,482
  • 2
  • 17
  • 35

1 Answers1

0

You can just pass the parameter you want in the route parameters:

 Router.go('thanks', {root: 'give', _id: something._id});
Hubert OG
  • 19,314
  • 7
  • 45
  • 73