Forum: Ruby on Rails cannot access flash from rjs helper

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jean-sébastien J. (Guest)
on 2007-08-03 00:44
(Received via mailing list)
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
This topic is locked and can not be replied to.