Module: Katalyst::HtmlAttributes::HasHtmlAttributes

Extended by:
ActiveSupport::Concern
Defined in:
lib/katalyst/html_attributes/has_html_attributes.rb

Overview

Adds HTML attributes to a component. Accepts HTML attributes from the constructor or via ‘html_attributes=`. These are merged with the default attributes defined in the component. Adds support for custom html attributes for other tags, e.g.:

define_html_attribute_methods :table_attributes, default: {}
tag.table(**table_attributes)

Constant Summary collapse

MERGEABLE_ATTRIBUTES =
HTMLAttributesUtils::DEFAULT_MERGEABLE_ATTRIBUTES,
  %i[data controller],
  %i[data action],
].freeze
FLATTENABLE_ATTRIBUTES =
[
  %i[data controller],
  %i[data action],
].freeze