# original code
<% if flash.any? %>
<% flash.each do |type, msg| %>
<p class="alert alert-<%= type %>">
<%= msg %>
</p>
<% end %>
<% end %>
# with aria-live
<% if flash.any? %>
<% flash.each do |type, msg| %>
<p class="alert alert-<%= type %>" aria-live="polite">
<%= msg %>
</p>
<% end %>
<% end %>
print "What is your name? "
user_input = gets.chomp.downcase!
if user_input.include? "s"
user_input.gsub!(/s/, "th")
else
print "There are no s's'"
end
puts "Adios. #{user_input}!"
# original code
<% if flash.any? %>
<% flash.each do |type, msg| %>
<p class="alert alert-<%= type %>">
<%= msg %>
</p>
<% end %>
<% end %>
# with aria-live
<% if flash.any? %>
<% flash.each do |type, msg| %>
<p class="alert alert-<%= type %>" aria-live="polite">
<%= msg %>
</p>
<% end %>
<% end %>
Comments