I am currently trying to catch posted values from form inside specific route rule. Since all the other SO posts about this do not work I wanted to ask again.Do you have this sorted out and implemented in your projects? Is there a solution for [email protected]?
this.request.body
Above code inside route rule always returns undefined.
Router.route('/register', function(){
console.log( JSON.stringify(this.request.body) );
//this.render('test',{data:{data:this.request.body.username}})
});
//SERVER ONLY
if (Meteor.isServer) {
Meteor.methods({
'addSong': function(songName) {
var userId = Meteor.userId()
songs.insert({
userId: userId,
name: songName
})
}
})
Router.onBeforeAction(Iron.Router.bodyParser.urlencoded({
extended: true
}));
}