You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
multi-model/views/articles/new.ejs

36 lines
735 B

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<header>
<h1>Create an Article</h1>
<nav>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<a href="/articles">Articles Index</a>
</li>
</ul>
</nav>
</header>
<main>
<form action="/articles" method="post">
<input type="text" name="title" /><br/>
<textarea name="body"></textarea><br/>
Choose and author:
<select name="authorId">
<% for(var i = 0; i < authors.length; i++) { %>
<option value="<%=authors[i]._id %>"><%=authors[i].name %></option>
<% } %>
</select><br/>
<input type="submit" value="Publish Article"/>
</form>
</main>
</body>
</html>