Flash update on remote call

Hello:

I’ve got a link on a page which fires a remote call. This remote call
just does a db operation on the back end. The end of the method that is
called remotely is just a:

render :update do |page|
end

I need to update the flash notice at the end of this remote call so that
the user has some feedback that the remote call was successful. For
some reason, both flash.update and flash.now aren’t working with
[:notice].

It seems as if I’m not understanding how flash works with remote calls.
Can someone point me to a resource that explains this?

Thanks!

Mike

On 8/5/07, Mike D. [email protected] wrote:

I need to update the flash notice at the end of this remote call so that
the user has some feedback that the remote call was successful. For
some reason, both flash.update and flash.now aren’t working with
[:notice].

It seems as if I’m not understanding how flash works with remote calls.
Can someone point me to a resource that explains this?

Flash works on the server-side, not on the client side. I think (if
someone else knows otherwise, please speak up) what most do is use
replace_html to update the content of the html element that wraps the
flash message. So if you have this:

<%=h flash[:notice] %>

Then you would do this:

render :update do |page|
page[:notice].replace_html “insert message here”
end