Flash Messages

Flash Messages

Flash messages are now rendered from a shared layout container and use typed variants.

Types

  • success (green) for successful create/update/delete and similar positive outcomes.
  • warning (yellow) for validation or recoverable user-facing issues.
  • error (red) for persistent errors that should remain visible until dismissed.
  • system (blue) for short-lived informational updates.

Legacy Rails keys are still supported:

  • notice maps to success.
  • alert maps to error.

Behavior

  • Flash messages are appended to the shared flash_messages container.
  • Each message has a close button handled by Stimulus flash controller.
  • Auto-hide behavior:
    • success, warning, system hide after ~5 seconds.
    • error persists until manually dismissed.

Turbo Stream updates

Controllers can append flash messages alongside other Turbo Stream updates through the shared flash concern helper methods:

  • flash_redirect_to / flash_redirect_back for typed redirects.
  • render_turbo_stream_with_flash for mixed stream payloads.