Module: Decidim::Comments::CommentCellsHelper

Included in:
CommentActivityCell, CommentCardCell, CommentMCell
Defined in:
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 'app/helpers/decidim/comments/comment_cells_helper.rb', line 8

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


16
17
18
19
20
# File '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 '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 'app/helpers/decidim/comments/comment_cells_helper.rb', line 24

def root_commentable_title
  decidim_html_escape(translated_attribute(root_commentable.title))
end

#url_paramsObject



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

def url_params
  { commentId: comment.id }
end