I am new to meteor and playing with a new project. Can someone tell me what the heck I am doing wrong. I have a simple form (projectForm) that I enter or edit project name, etc… This all works. But when I click submit, it saves the data and goes back to the page projects which is what I want but then immediately it goes back to projectForm (empty). I have read many posts and tried them all.
I am using iron router for my routes.
Here is my code.
if (this._id){
Meteor.call('update',this._id,obj);
} else {
Meteor.call('addProjects', name, smartsheet_id);
}
event.target.name.value = "";
event.target.smartsheet_id.value = "";
Router.go('projects');
return False;
Routes.js
Router.map(function(){
this.route('projectForm', {
name: 'projectForm',
template: 'projectForm',
});
this.route('projects', {
name: 'projects',
path: '/projects',
template: 'projects',
});
this.route('/update/:_id',{
name: 'update',
template:'projectForm',
data:function(){
//alert(this.params._id);
return Projects.findOne({_id: this.params._id});
}
});
}); ```