Make flash messages accessible to screen readers

PHOTO EMBED

Fri Jun 17 2022 09:16:41 GMT+0000 (Coordinated Universal Time)

Saved by @metamoni #ruby #rubyonrails

# with aria-live
<% flash.each do |msg| %>
  <p aria-live="polite" aria-atomic="true"><%= msg %></p>
<% end %>
 
# with role
<% flash.each do |msg| %>
  <p role="status"><%= msg %></p>
<% end %>
content_copyCOPY