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-border-gray-300 ariadne-border ariadne-shadow ariadne-py-5 ariadne-px-5 ariadne-rounded-md "
Constants inherited from Component
Ariadne::Component::BASE_HIDDEN_CLASS, 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: :post, 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: :post, sr_label:, classes: "", attributes: {}) ⇒ CommentComponent
Returns a new instance of CommentComponent.
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'app/components/ariadne/comment_component.rb', line 55 def initialize(url:, method: :post, 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 end |