lib/decidim/comments/comments_helper.rb in decidim-comments-0.18.1 vs lib/decidim/comments/comments_helper.rb in decidim-comments-0.19.0
- old
+ new
@@ -7,10 +7,11 @@
# Render commentable comments inside the `expanded` template content.
#
# resource - A commentable resource
def comments_for(resource)
return unless resource.commentable?
+
content_for :expanded do
inline_comments_for(resource)
end
end
@@ -19,9 +20,10 @@
# resource - A commentable resource
#
# Returns a div which contain a RectComponent
def inline_comments_for(resource)
return unless resource.commentable?
+
commentable_type = resource.commentable_type
commentable_id = resource.id.to_s
node_id = "comments-for-#{commentable_type.demodulize}-#{commentable_id}"
react_comments_component(node_id, commentableType: commentable_type,
commentableId: commentable_id,