Sha256: 727b7812438f89b900291292882aaae381e4a228e91a4e6eb14175e1d4b1666b

Contents?: true

Size: 360 Bytes

Versions: 8

Compression:

Stored size: 360 Bytes

Contents

module CommentsHelper
  def nested_comments(comments)
    comments.map do |comment, sub_comments|
      next if comment.id.blank?
      
      content = render(partial: 'comments/resource', locals: { resource: comment }) 
      content += content_tag(:div, nested_comments(sub_comments), class: 'nested_comments')
      content
    end.join.html_safe
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
voluntary-0.1.0 app/helpers/comments_helper.rb
voluntary-0.1.0.rc4 app/helpers/comments_helper.rb
voluntary-0.1.0.rc3 app/helpers/comments_helper.rb
voluntary-0.1.0.rc2 app/helpers/comments_helper.rb
voluntary-0.1.0.rc1 app/helpers/comments_helper.rb
voluntary-0.0.3 app/helpers/comments_helper.rb
voluntary-0.0.2 app/helpers/comments_helper.rb
voluntary-0.0.1 app/helpers/comments_helper.rb