0
I am working with Ejs and Node.JS with Mysql. I need to move to a two table info calculation view, but I am facing this error:
app.get("/calc", (req, res)=>{
Palpite.findAll().then(calc =>{
res.render("calc/index", {calc: calc})
}).then(()=>{
RPalpite.findAll().then(rp =>{
res.render("calc/index", {rp: rp})
})
})
})
Error:
Referenceerror: Rp is not defined
<% rp.forEach(rpal=>{ %>
<tr>
<th scope="row"><%= rpal.id %></th>
<th scope="row"><%= rpal.rp1 %></th>
<th scope="row"><%= rpal.rp2 %></th>
<th scope="row"><%= rpal.rp3 %></th>
<th scope="row"><%= rpal.rp4 %></th>
<th scope="row"><%= rpal.rp5 %></th>
</tr>
<% }) %>
Hello, welcome to the O.R.! So that people can help you better, try to describe better what you have done and the result you would like to have with the code. More detailed questions help in understanding doubt.
– RxT