With this code I am supposed to make flashes with the key success different from the others by only showing the value and not the close_flash and flash_background as you can see. It doesn’t work, but what do I do wrong?
<% flash.each do |key, value| %>
<% if key == "success" %>
<div class="flash_<%= key %>"><%= value %></div>
<% else %>
<div class="flash_<%= key %>">
<%= value %> <a href="#" class="close_flash">x</a>
</div>
<div class="flash_background"></div>
<% end %>
<% end %>
the flash uses symbols:
In many cases, rails hashes are implemented with indifferent access. This would mean o[:a] == o[‘a’] (specifically, o[:a].object_id == o[‘a’].object_id).
http://api.rubyonrails.org/classes/Hash.html#method-i-with_indifferent_access