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
- #renderable? ⇒ Boolean
- #resource_link_path ⇒ Object
- #resource_link_text ⇒ Object
- #root_commentable_title ⇒ Object
- #url_params ⇒ Object
Instance Method Details
#renderable? ⇒ 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 |
#resource_link_path ⇒ Object
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 |
#resource_link_text ⇒ Object
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_title ⇒ Object
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_params ⇒ Object
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 |