Sha256: a972ea672b688509521765157a0ee03e27bb6036563eead292469d3baf66e59e

Contents?: true

Size: 442 Bytes

Versions: 8

Compression:

Stored size: 442 Bytes

Contents

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

Version data entries

8 entries across 8 versions & 1 rubygems

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