Module: Components::ToastHelper

Defined in:
app/helpers/components/toast_helper.rb

Instance Method Summary collapse

Instance Method Details

#render_toast(header: nil, description: nil, action: nil, class: nil, data: {}, variant: :default, **options, &block) ⇒ Object



2
3
4
5
6
7
# File 'app/helpers/components/toast_helper.rb', line 2

def render_toast(header: nil, description: nil, action: nil, class: nil, data: {}, variant: :default, **options, &block)
  options[:class] ||= ""
  options[:class] << " destructive group border-destructive bg-destructive text-destructive-foreground " if variant == :destructive

  render "components/ui/toast", header:, description:, action:, class:, data:, options: options
end