Module: Decidim::Comments::CommentCellsHelper

Included in:
CommentActivityCell, CommentCardCell, CommentSCell
Defined in:
decidim-comments/app/helpers/decidim/comments/comment_cells_helper.rb

Overview

Custom helpers for comments cells.

Instance Method Summary collapse

Instance Method Details

#renderable?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'decidim-comments/app/helpers/decidim/comments/comment_cells_helper.rb', line 8

def renderable?
  comment.present? && root_commentable.present?
end


16
17
18
19
20
# File 'decidim-comments/app/helpers/decidim/comments/comment_cells_helper.rb', line 16

def resource_link_path
  return root_commentable.polymorphic_resource_path(url_params) if root_commentable.respond_to?(:polymorphic_resource_path)

  resource_locator(root_commentable).path(url_params)
end


12
13
14
# File 'decidim-comments/app/helpers/decidim/comments/comment_cells_helper.rb', line 12

def resource_link_text
  comment.formatted_body
end

#root_commentable_titleObject



24
25
26
# File 'decidim-comments/app/helpers/decidim/comments/comment_cells_helper.rb', line 24

def root_commentable_title
  decidim_escape_translated(root_commentable.title)
end

#url_paramsObject



28
29
30
# File 'decidim-comments/app/helpers/decidim/comments/comment_cells_helper.rb', line 28

def url_params
  { commentId: comment.id, anchor: "comment_#{comment.id}" }
end