node.js - Unable to call views -


i'm using sails , when attempt call login action of userscontroller view response not getting loaded. know routing working, because console.log logs both loginpassword , loginname. however, res.view() doesn't work. neither 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 /views/user/login.ejs , contains header block test text, can't render @ all. thoughts?

edit: i've noticed when @ chrome developer tools , view response portion of network tab, i've getting view loaded layout <%-body%> page not loading returned view. bug or doing stupid? i'm on latest stable.

here's code: https://github.com/freefallgeek/sailtstest

the problem seems using jquery.post ajax request , don't render response.

http://api.jquery.com/jquery.post/

you might want use form , optionaly submit form js/jquery.

alternatively need render partial html in success function of jquery.post


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -