Add markdown preview; fix bug with deleted editor

This commit is contained in:
jomo
2014-05-11 06:43:56 +02:00
parent df030f4d2d
commit 19eb868a50
19 changed files with 135 additions and 39 deletions

View File

@@ -1,8 +1,7 @@
<h1>Edit post</h1>
<%= form_for @post do |f|%>
<%= f.text_field :title %>
<%= render partial: "mdhelp" %>
<%= f.text_area :content%>
<%= render partial: "md_editor", locals: {name: "blogpost[content]", content: @post.content, mini: false} %>
<p><%= f.submit "Update Post", class: "btn blue left" %></p>
<% end %>
<p><%= button_to "Delete post", @post, method: "delete", data: {confirm: "Delete post & comments forever?"}, class: "btn red right" %></p>

View File

@@ -1,8 +1,7 @@
<h1>New Post</h1>
<%= form_for @post do |f|%>
<%= f.text_field :title, placeholder: "Title" %>
<%= render partial: "mdhelp" %>
<%= f.text_area :content, placeholder: "Text" %>
<%= render partial: "md_editor", locals: {name: "blogpost[content]", content: @post.content, mini: false} %>
<p><%= f.submit "Create Post", class: "btn blue left" %></p>
<div class="clear"></div>
<% end %>