I\'m using Meteor with AutoForm & Iron Router.
I have an autoform for inserting a data, and I want to redirect to the page of the data I added after a successful
According to the doc on github, signatures changed: don't forget to declare the forms or null to apply the hooks.
for all forms
AutoForm.addHooks(null,{
onSuccess: function(formType, result) {
Router.go('page',{_id: this.docId});
}
});
for specific form
AutoForm.addHooks(['yourForm'],{
onSuccess: function(formType, result) {
Router.go('page',{_id: this.docId});
}
});
Best is to check the up to date signatures: https://github.com/aldeed/meteor-autoform#callbackshooks