在index.js的keystonejs中发送post请求

我有一个联系表单,我添加到我的index.jade文件,我想发送请求到/path使用以下代码在玉模板呈现罚款。

if enquirySubmitted .row h3 Thanks for getting in touch. else .row form.contact-form(method="post" ) input(type='hidden', name='action', value='contact') .col-lg-4.col-sm-4(class=validationErrors.name ? 'has-error' : null) input.form-control.input-box(type='text', name='name.full', value=formData['name.full'], placeholder='Your Name') .col-lg-4.col-sm-4 input.form-control.input-box(type='email', name='email', value=formData.email, placeholder='Your Email') .col-lg-4.col-sm-4 div(class=validationErrors.enquiryType ? 'has-error' : null) input.form-control.input-box(type='text', name='enquiryType' value=formData.enquiryType) .col-md-12(class=validationErrors.message ? 'has-error' : null) .col-md-12 textarea.textarea-box(name='message')= formData.message button(type='submit') Send Message 

以下是index.js文件中的邮政编码

  locals.section = 'contact'; locals.formData = req.body || {}; locals.validationErrors = {}; locals.enquirySubmitted = false; // On POST requests, add the Enquiry item to the database view.on('post', { action: 'contact' }, function(next) { console.log('here'); var newEnquiry = new Enquiry.model(), updater = newEnquiry.getUpdateHandler(req); updater.process(req.body, { flashErrors: true, fields: 'name, email, phone, message', errorMessage: 'There was a problem submitting your enquiry:' }, function(err) { if (err) { locals.validationErrors = err.errors; } else { locals.enquirySubmitted = true; } next(); }); }); 

我遇到的问题是没有任何错误或“在这里”被显示,以显示在后台收到发布请求。 我一直无法解决这个问题,并对我还需要做什么让联系表单工作感到困惑。 看着keystone演示没有帮助。 index.js文件位于routes/views/index.js