# Flash messages gets lost

**URL:** <https://www.ruby-forum.com/t/flash-messages-gets-lost/105858>\
**Category:** Rails\
**Created:** [June 3, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/flash-messages-gets-lost/105858 "2007-06-03T21:51:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [June 3, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/flash-messages-gets-lost/105858/1 "2007-06-03T21:51:59Z")

</div>

Hi,

I´m using form\_remote\_tag to submit a query, but the flash messages  
returned from the controller is lost somewhere. loading.gif is  
displayed as it should be. What am I doing wrong? 🙂  
Should form\_remote\_tag update the div field with the flash-messages?

view.rhtml:

 \<%= display\_standard\_flashes %\>

```
<p style="color: green"><%= flash[:notice] %></p>
<p style="color: green"><%= flash[:warning] %></p>

<%= yield :layout %>

```

\_talk.rhtml:

# Send messages

\<%= flash[:notice] %\>

\<%= flash[:warning] %\>

\<%= content\_tag("div", flash[:notice], :id =\> "notice", :class =\> "flash") %\>

\<% form\_remote\_tag(:url =\> {:action =\> 'tell\_me},  
:before =\> “Element.show(‘spinner’);”,  
:success =\> “show\_results(xhr);”,  
:failure =\> “show\_error(xhr);”,  
:complete =\> “Element.hide(‘spinner’);”) do %\>

\<%= display\_standard\_flashes %\>

application\_helper.rb:  
module ApplicationHelper  
def display\_standard\_flashes  
html= “”

```
  html = "I can see this is the view!"

  if flash[:notice]
    html << content_tag("div", flash[:notice], :id =>

```

“notice”, :class =\> “flash”)  
html \<\< javascript\_tag( visual\_effect(:highlight, ‘notice’) )  
end

```
  if flash[:warning]
    html << content_tag("div", flash[:warning], :id =>

```

“warning”, :class =\> “flash”)  
html \<\< javascript\_tag( visual\_effect(:highlight, ‘warning’) )  
end

```
  if flash[:error]
    html << content_tag("div", flash[:error], :id =>

```

“error”, :class =\> “flash”)  
html \<\< javascript\_tag( visual\_effect(:highlight, ‘error’) )  
end

```
  html
end

```

end

–  
Regards,  
Martin S.
