# Cannot access flash from rjs helper

**URL:** <https://www.ruby-forum.com/t/cannot-access-flash-from-rjs-helper/111132>\
**Category:** Rails\
**Created:** [August 2, 2007, 10:44pm UTC](https://www.ruby-forum.com/t/cannot-access-flash-from-rjs-helper/111132 "2007-08-02T22:44:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jney](https://www.ruby-forum.com/u/jney)\
**Post date:** [August 2, 2007, 10:44pm UTC](https://www.ruby-forum.com/t/cannot-access-flash-from-rjs-helper/111132/1 "2007-08-02T22:44:19Z")

</div>

all is in the title :). I’ve got an rjs file calling  
“page.ajax\_flash\_alert”.  
This method is defined in Application helper in which i do this :  
if flash.size \> 0  
flash.each do |key, msg|  
page.insert\_html(:bottom, :alert, content\_tag(:div, msg, :class =\>  
key))  
end  
end

But the flash content is lost.  
When i put the code directly in the rjs file it works.

Someone can help?

regards
