Forum: Ruby on Rails Flash Errors

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
bradigan (Guest)
on 2007-07-17 07:35
(Received via mailing list)
I have a form and a model with some validation.

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
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.
George (Guest)
on 2007-07-17 08:11
(Received via mailing list)
On 7/17/07, bradigan <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?

This topic is locked and can not be replied to.