Files
growstuff/app/views/comments/_form.html.haml
Miles Gould 2b84fa8bad Show previous comments when creating a comment.
- Move "show previous comments" into a partial
 - invoke said partial from the new comment form
 - add tests.
2013-04-29 21:30:26 +01:00

23 lines
720 B
Plaintext

= render :partial => "posts/single", :locals => { :post => @post || @comment.post, :subject => true }
= render :partial => "posts/comments"
%h2 Your comment
= form_for @comment do |f|
- if @comment.errors.any?
#error_explanation
%h2= "#{pluralize(@comment.errors.count, "error")} prohibited this comment from being saved:"
%ul
- @comment.errors.full_messages.each do |msg|
%li= msg
.field
= f.text_area :body, :rows => 6, :class => 'input-block-level'
%span.help-block
= render :partial => "shared/markdown_help"
.actions
= f.submit 'Post comment', :class => 'btn btn-primary'
- if defined?(@post)
.field
= f.hidden_field :post_id, :value => @post.id