Refactored nested comments. Now using partial to load them

This commit is contained in:
Shayon Mukherjee 2015-02-27 11:11:14 -06:00
parent cc66027220
commit 54bcc89204
4 changed files with 28 additions and 26 deletions

View file

@ -0,0 +1,15 @@
%div{style: "padding-left:#{padding}px"}
.well.comment-section
%strong= comment.user.name
%i= comment.created_at
%p.comment-body= comment.body
%div
%a.pull-right.comment-reply-link{href: "#"} Reply
.comment-reply
= form_tag "#{comment_admin_conference_event_path(@conference.short_title, comment.commentable_id)}", method: :post do
%input{name: "parent", type: "hidden", value: "#{comment.id}"}
%input{name: "authenticity_token", type: "hidden", value: "#{form_authenticity_token}"}
%textarea{name: "comment"}
%button.btn.btn-primary.pull-right{name: "button", type: "submit"} Add Reply
- comment.children.each do |child|
= render "nested_comments", comment: child, padding: 50