Module: LocoMotion::Concerns::TurboableComponent

Extended by:
ActiveSupport::Concern
Defined in:
lib/loco_motion/concerns/turboable_component.rb

Overview

Can be included in linkable components to provide first-class keyword options for the most common Turbo data attributes, instead of hand-writing the nested html: { data: { ... } } hash. This mirrors the way TippableComponent sugars tip over data-tip.

Option Emitted attribute
turbo_frame data-turbo-frame
turbo_action data-turbo-action
turbo_method data-turbo-method
turbo_confirm data-turbo-confirm

Each attribute is only emitted when its option is provided, and anything passed explicitly via html: { data: { ... } } still takes precedence (user HTML is deep-merged over these defaults).