there is no reason that the flash display the notice but not the
error. maybe it's your div 'errorbox' isn't displayed. try this in
your page to check if flash have values :
- flash.each do |key,value|
= key.to_s + '=>' + value.to_s
(i'm not sure about haml synthax)
you will see something like :
notice=>Asset was successfully created.
or
error=>There were some problems on the creation of the asset.
Because the div 'errorbox' is working fine. And when I try with your
code I have no value for the flash notices. However, I have no problem
with flash errors and warnings. Although I do the same way for errors,
warnings and notices, it seems that the problem is only with the
notices.
Flash is kind of a hash table, the name of the keys (:notice, :error, ...) is not important to how it works, you can pass messages to the user with :foo instead of :notice.
You surely have a logic flaw somewhere. You know that flash[:key] evaluates to what you expect in the _next_ request right? Normally there's a redirection in between.