Unable to call views
Posted
by
Scott
on Stack Overflow
See other posts from Stack Overflow
or by Scott
Published on 2014-06-03T03:22:29Z
Indexed on
2014/06/03
3:24 UTC
Read the original article
Hit count: 98
I'm using Sails and I when I attempt to call the login action of my UsersController. I know my routing is working, because the console.log successfully logs both the loginpassword and loginname. However, the res.view() doesn't work. Neither does returning res.view().
module.exports = {
create: function(req, res) { },
destroy: function(req, res) {
},
login: function(req, res) { var loginname = req.param("loginname");
var loginpassword = req.param("loginpassword");
console.log(loginname + ' ' + loginpassword);
res.view();
},
logout: function(req, res) {
},
_config: {}
};
I have a /views/user/login.ejs and all it currently contains is a header block with some test text, but I can't get that to render at all. Any thoughts?
© Stack Overflow or respective owner