Sha256: 03b082f288ce63e9ea21bca753860d08b0338f2d8cc79c5612a73d73c16467cd

Contents?: true

Size: 403 Bytes

Versions: 13

Compression:

Stored size: 403 Bytes

Contents

module Voluntary
  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
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
voluntary-0.7.1 app/helpers/voluntary/comments_helper.rb
voluntary-0.7.0 app/helpers/voluntary/comments_helper.rb
voluntary-0.6.0 app/helpers/voluntary/comments_helper.rb
voluntary-0.5.2 app/helpers/voluntary/comments_helper.rb
voluntary-0.5.1 app/helpers/voluntary/comments_helper.rb
voluntary-0.5.0 app/helpers/voluntary/comments_helper.rb
voluntary-0.4.0 app/helpers/voluntary/comments_helper.rb
voluntary-0.3.0 app/helpers/voluntary/comments_helper.rb
voluntary-0.2.4 app/helpers/voluntary/comments_helper.rb
voluntary-0.2.3 app/helpers/voluntary/comments_helper.rb
voluntary-0.2.2 app/helpers/voluntary/comments_helper.rb
voluntary-0.2.1 app/helpers/voluntary/comments_helper.rb
voluntary-0.2.0 app/helpers/voluntary/comments_helper.rb