Class: Decidim::Comments::CommentFormCell

Inherits:
ViewModel
  • Object
show all
Defined in:
app/cells/decidim/comments/comment_form_cell.rb

Overview

A cell to display a form for adding a new comment.

Instance Method Summary collapse

Instance Method Details

#comment_as_for(form) ⇒ Object



7
8
9
10
11
12
13
14
# File 'app/cells/decidim/comments/comment_form_cell.rb', line 7

def comment_as_for(form)
  return if verified_user_groups.blank?

  # Note that the form.select does not seem to work correctly in the cell
  # context. The Rails form builder tries to call @template.select which
  # is not available for the cell objects.
  render view: :comment_as, locals: { form: }
end

#two_columns_layout?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'app/cells/decidim/comments/comment_form_cell.rb', line 16

def two_columns_layout?
  model.respond_to?(:two_columns_layout?) && model.two_columns_layout?
end