app/views/admin/pages/_form.html.erb
<%= form_for [:admin, @page] do |f| %>
<div class="form-row">
<div class="form-group col-md-4">
<%= f.label :path %>
<%= f.text_field :path, required: true, class: "form-control", readonly: f.object.embedded? %>
</div>
<div class="form-group col-md-8">
<%= f.label :title %>
<%= f.text_field :title, required: true, class: "form-control", readonly: f.object.embedded? %>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<%= f.label :body %>
<%= f.text_area :body, class: "form-control" %>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<%= f.submit %>
</div>
</div>
<% end %>
<% content_for(:head) do -%>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
<script>
window.addEventListener('load', function (event) {
new SimpleMDE({element: document.getElementById("page_body")})
})
</script>
<% end -%>