So, I'd like to be able to display both a flash[:notice] and a flash[:error] on the same action, but I'd like for the :notice to always be displayed above (or before) the error. Is there a way to do this?
In my controller, I thought I could just code the flash[:error] before the flash[:notice], so that rails will display it correctly, and it does a vast majority of the time. But every now and then they are randomly switched, and I can't seem to figure out why. So, how can I ensure that a flash[:notice] is always displayed above an :error ?
Edit: Thanks to Ben's and Ryan's advice, I've now just set up conditionals in my layout/application file.
<% if flash[:notice] %>
<div id="flash_notice"><%= flash[:notice] %></div>
<% end %>
<% if flash[:error] %>
<div id="flash_error"><%= flash[:error] %></div>
<% end %>
I'm pretty satisfied with this, but maybe there's an even better way?
Edit #2: Yes, there is. Ben added it to his answer below. Thanks again Mr. Ben.