Hi Adrien, methods you define in your helpers are not available on the page object.
Thus, as you described, if you want to call your helper-method 'reload_flash' in the controller, you have to pass the page param... I doubt that the code of the example you describe ever worked with any rails-version... Andi On Oct 7, 4:50 pm, Adrien Coquio <[email protected]> wrote: > 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 > pagehttp://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 ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

