Hi,
I try do update the flash on my page with ajax.
I have this on my layout :
<div id="flash_messages"> <%= render :partial => 'layouts/flash' %> </div>
I have this on my ApplicationHelper :
def reload_flash page.replace "flash_messages", :partial => 'layouts/flash' end
and I try do that on my controller :
render :update do |page| flash[:notice] = "Entering 'beast mode'..." page.reload_flash end
but I have an error, to fix it i need to add a parameter page on my function reload_flash and call this function with reload_flash(page) instead of page.reload_flash, that's work but I think It's a bit weird, I prefer write something without parameter. Do you know how i can do that ?
In fact this code is from this page http://www.whatcodecraves.com/articles/2008/12/13/rails_flash_with_ajax/ and the author says he use it. Is it with available in an older version of rails ?