0
ビュー内で{{#each rows}}ループを使用していますが、反復処理中のオブジェクト配列は描画されません。 res.send(rows)を使用するとオブジェクト配列が表示され、結果が返されます。 このサーバーをcloud9プラットフォームで実行すると、オブジェクト属性でいっぱいになった表がレンダリングされますが、Amazon Web Serverでこのサーバーを実行しようとすると、ビューがレンダリングされますが、#eachループはレンダリングされず、ページソースを見ると、行は受信されていないようです。しかし、再びres.send(rows)を実行すると、行オブジェクト配列が表示されます。 私は本当に助けていただければ幸いです。ハンドルバーjsはオブジェクト配列を描画しません。mysql query(nodejsサーバ内)
<h1>Donors</h1>
<div class="col-md-8">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Name
<th>Address
<th>City
<th>State
<th>Zip
<th>Specific Location</th>
</tr>
</thead>
<tbody>
{{#each rows}}
<tr>
<td>{{this.name}}
<td>{{this.street_address}}
<td>{{this.city}}
<td>{{this.state}}
<td>{{this.zip}}
<td>{{this.specific_location}}
</tr>
{{/each}}
</tbody>
</table>
</div>
<div class="col-md-4">
<form role="form" action="/Donors/business" method="POST">
<fieldset>
<legend>See Available Food From a Specific Donor:</legend>
<div class="form-group">
<label for="Specific_donor">Pick a Specific Donor:</label>
<select class="form-control" name="business_id" id="business_id">
<option>--Select Donor--</option>
{{#each businesses}}
<option value={{this.id}}>{{this.name}}</option>
{{/each}}
</select>
<input type="submit" id="entrySubmitABusiness" class="btn btn-primary">
</fieldset>
</form>
</div>
これは修正されました。ありがとうございます! 私の質問を投稿する前に、私は試みました:res.render( 'Donors/business/index'、{行}); ですが、予期しないトークン、というエラーが表示されました。もう一度、ありがとう! – wilsonsk