이렇게 적고 Submit 버튼을 누르면 DB에 잘 저장이 됩니다.
그런데 게시글을 누르면 아래처럼 나오네요 ㅠㅠ
제가 MEAN 스택으로 개발하고 있어서
이게 Schema고
var reviewSchema = new mongoose.Schema({
title: String,
author: String,
paper: String,
content: String
})
이게 두번째사진 코드입니다.
<% include partials/header.ejs %>
<div class="container">
<h1> <%= review.title%></h1>
<h3> <%= review.author %> - <%= review.paper %></h3>
<a role="button" class="addbutton btn btn-default btn-info" href="<%=review._id%>/edit" style="margin-left: 0px;">Edit</a>
<form action="/reviews/<%=review._id%>?_method=DELETE" method="POST">
<button class="addbutton btn btn-default btn-danger" style="margin-left: 0px">Delete</button>
</form>
<hr>
<div class="form-group">
<div id="wmd-preview" class="wmd-preview"> <%= review.content %> </div>
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Converter.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Editor.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Sanitizer.js"></script>
<script>
var converter = Markdown.getSanitizingConverter();
var editor = new Markdown.Editor(converter);
editor.run();
</script>
<% include partials/footer.ejs%>