Class: Ariadne::CommentComponent
- Defined in:
- app/components/ariadne/comment_component.rb
Overview
Defines a submittable form for adding comments to a conversation. attribute, which will be used to label the tabs for screen readers.
Constant Summary collapse
- DEFAULT_TAG =
:div- TAG_OPTIONS =
[DEFAULT_TAG].freeze
- DEFAULT_CLASSES =
"ariadne-bg-white ariadne-border-gray-300 ariadne-border ariadne-shadow ariadne-py-5 ariadne-px-5 ariadne-rounded-md "
Constants inherited from Component
Ariadne::Component::BASE_BODY_CLASSES, Ariadne::Component::BASE_HTML_CLASSES, Ariadne::Component::BASE_MAIN_CLASSES, Ariadne::Component::BASE_WRAPPER_CLASSES, Ariadne::Component::INVALID_ARIA_LABEL_TAGS
Constants included from ActionViewExtensions::FormHelper
ActionViewExtensions::FormHelper::DEFAULT_FORM_CLASSES
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::INTEGER_TYPES, FetchOrFallbackHelper::InvalidValueError, FetchOrFallbackHelper::TRUE_OR_FALSE
Instance Method Summary collapse
-
#initialize(url:, method:, sr_label:, classes: "", attributes: {}) ⇒ CommentComponent
constructor
A new instance of CommentComponent.
Methods included from ActionViewExtensions::FormHelper
Methods included from ClassNameHelper
Methods included from LoggerHelper
#logger, #silence_deprecations?, #silence_warnings?
Methods included from FetchOrFallbackHelper
#check_incoming_attribute, #check_incoming_tag, #check_incoming_value, #fetch_or_raise, #fetch_or_raise_boolean, #fetch_or_raise_integer
Constructor Details
#initialize(url:, method:, sr_label:, classes: "", attributes: {}) ⇒ CommentComponent
Returns a new instance of CommentComponent.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/components/ariadne/comment_component.rb', line 41 def initialize(url:, method:, sr_label:, classes: "", attributes: {}) @tag = DEFAULT_TAG @classes = class_names( DEFAULT_CLASSES, classes, ) @url = url @method = method @sr_label = sr_label @tab_idx = -1 @attributes = attributes @attributes[:"data-controller"] = "comment-component" attributes[:"data-comment-component-target"] = "commentComponent" end |