There I go again. I have a function where you make a record in the MySQL database it is working. But when trying to get data from an input I get the following error:
TypeError: Can not read property 'user' of undefined
Node:
exports.AddUser = function(request, reponse){
console.log('Email: ', reponse.body.user.email);
Model.addUser({email_usuario: Math.random() , senha_usuario:'sds' }, function(user){
reponse.render('user/add', {
title: 'cadastro'
});
});
};
Jade:
extends ../layout
block content
form(action="../user/add", method="post")
label Email
input(type="text" name="user[email]")
label senha
input(type="password" name="user[senha]")
button(type="submit") Cadastrar
br
I already tried with reponse.body.email
, input(type="text" name="senha")
and it did not work, what's wrong here?