Files
growstuff/app/views/posts/show.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

18 lines
665 B
Plaintext

= content_for :title, @post.subject
= render :partial => "single", :locals => { :post => @post, :subject => false, :hide_comments => true }
- if can? :edit, @post or can? :destroy, @post
.post-actions
- if can? :edit, @post
= link_to 'Edit Post', edit_post_path(@post), :class => 'btn btn-mini'
- if can? :destroy, @post
= link_to 'Delete Post', @post, method: :delete, |
data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini'
= render :partial => "comments", :locals => { :post => @post }
- if can? :create, Comment
.post-actions
=link_to 'Comment', new_comment_path(:post_id => @post.id), :class => 'btn btn-primary'