# Flash Errors

**URL:** <https://www.ruby-forum.com/t/flash-errors/109591>\
**Category:** Rails\
**Created:** [July 17, 2007, 5:35am UTC](https://www.ruby-forum.com/t/flash-errors/109591 "2007-07-17T05:35:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradigan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/87869e/32.png) [@bradigan](https://www.ruby-forum.com/u/bradigan)\
**Post date:** [July 17, 2007, 5:35am UTC](https://www.ruby-forum.com/t/flash-errors/109591/1 "2007-07-17T05:35:49Z")

</div>

I have a form and a model with some validation.  
/event/new/

When I just click an empty form (or fill in a few fields) I do get my  
validation error no problem.  
However, if I click the link at the top of the page that just takes me  
to the same  
/event/new  
page without any post etc,  
The Flash error still displays in my layout.

This is what I have code wise

```
  <% unless flash[:error].blank? -%>
    <div class="flash_error"><%= flash[:error] %></div>
    <div class="clear">&nbsp;</div>
  <% end -%>

```

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![bradigan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/87869e/32.png) [@bradigan](https://www.ruby-forum.com/u/bradigan)\
**Post date:** [July 17, 2007, 6:11am UTC](https://www.ruby-forum.com/t/flash-errors/109591/2 "2007-07-17T06:11:51Z")

</div>

On 7/17/07, bradigan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The Flash error still displays in my layout.  
> Hi Brad,

I think the controller code would be more relevant here.

Storing stuff in the flash means it’ll be there for the next request.  
You probably only want to store stuff there if you respond with a  
redirect. Perhaps you’re storing your errors in flash, and just doing  
a render instead?

Regards,  
George.
