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:
noticemaps tosuccess.alertmaps toerror.
Behavior
- Flash messages are appended to the shared
flash_messagescontainer. - Each message has a close button handled by Stimulus
flashcontroller. - Auto-hide behavior:
success,warning,systemhide after ~5 seconds.errorpersists 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_backfor typed redirects.render_turbo_stream_with_flashfor mixed stream payloads.