Hello I am new to ruby on rails and I am struggling to understand I18n\'s flash messages. I am using devise, rails 4, and twitter bootstrap.I understand that devise only use
Here's my 2 cents.
Using a case statement to check if the flash names are the older syntax alertor notice and change them to success or danger if they are and leave everything else alone.
<% flash.each do |name, msg| %>
<% if msg.is_a?(String) %>
<%= content_tag :div, msg, :id => "flash_#{name}" %>
<% end %>
<% end %>
and a helper method
def flash_class_name(name)
case name
when 'notice' then 'success'
when 'alert' then 'danger'
else name
end
end