Toast

A short confirmation after an action.

Helper
toast(message, variant: :default, dismiss_after: 6000) do |t|
  t.with_action { … }
end

toasts(flash: nil)  # without a block, shows the flash

toasts without a block shows the flash (notice as a toast, alert as an error toast); put it once in the layout. Toasts leave after dismiss_after milliseconds (0 keeps them).

12 notas sincronizadas.