Permalink
Browse files

Show editor in edit form

  • Loading branch information...
1 parent a5eb5de commit 4bf42a4fc8e70b1fb8df09d613d2db83b9380245 @mutle committed Jan 3, 2013
Showing with 3 additions and 7 deletions.
  1. +2 −2 app/views/channels/_form.html.haml
  2. +1 −5 app/views/posts/edit.html.haml
@@ -1,6 +1,6 @@
-=hidden_field_tag "syntax", current_user.markdown? ? "md" : "html", :id => "syntax"
+=hidden_field_tag "syntax", @post && !@post.new_record? ? @post.markdown? : current_user.markdown? ? "md" : "html", :id => "syntax"
%p.comment_box_container
=f.text_area :body, :class => 'comment_box'
%p.right
%span.upload_info
- =f.submit 'Add Comment', :accesskey => "s"
+ =f.submit @post && !@post.new_record? ? 'Update Comment' : 'Add Comment', :accesskey => "s"
@@ -1,8 +1,4 @@
%h2 Editing comment
=form_for :post, :url => channel_post_path(@channel, @post), :html => {:method => :put} do |f|
- %p
- ~f.text_area :body, :class => 'comment_box'
- %p.right
- =f.submit 'Update Comment', :accesskey => "s"
+ =render :partial => "channels/form", :locals => {:f => f}
.clear
-=javascript_tag "add_editor('post_body');"

0 comments on commit 4bf42a4

Please sign in to comment.