Reputation: 12147
I have a route to display user parameters: admin/users/details/:userID In the template associated with this route I have "Back" button.
What is the best way to pass "return route path" to Router.go() and access it later in
Template.AdminUsersDetailsDetailsForm.events({
"click #form-back-button": function(e, t) {
e.preventDefault();
Router.go(PARAM.NAME, {});
}
Upvotes: 0
Views: 3251
Reputation: 5273
Read about it here
Router.route( '/admin/users/details/:userID', {
name: 'admin.details',
...
} );
Template.AdminUsersDetailsDetailsForm.events({
"click #form-back-button": function(e, t) {
e.preventDefault();
Router.go('admin.details', {userId:'USER_ID'});
}
You can generate url using:
Router.path('admin.details', {userId:'USER_ID'});
Upvotes: 0