What is the layout `yield` method in ejs?

Problem

I’m just starting with node.js + express + ejs. I can’t find anywhere how to pull in the requested ejs file to the layout file.

I know full well that yield is not the right thing here.

e.g.

layout.ejs

<html>
<head><title>EJS Layout</title></head>
<body>
<%= yield %>
</body>
</html>

index.ejs

<p>Hi</p>

Problem courtesy of: Ryan Florence

Solution

Finally found some source code for an express app:

<%- body %>

Solution courtesy of: Ryan Florence

View additional discussion.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.