# Flash update on remote call

**URL:** <https://www.ruby-forum.com/t/flash-update-on-remote-call/111307>\
**Category:** Rails\
**Created:** [August 5, 2007, 3:24pm UTC](https://www.ruby-forum.com/t/flash-update-on-remote-call/111307 "2007-08-05T15:24:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@miked](https://www.ruby-forum.com/u/miked)\
**Post date:** [August 5, 2007, 3:24pm UTC](https://www.ruby-forum.com/t/flash-update-on-remote-call/111307/1 "2007-08-05T15:24:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![miked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@miked](https://www.ruby-forum.com/u/miked)\
**Post date:** [August 6, 2007, 2:20pm UTC](https://www.ruby-forum.com/t/flash-update-on-remote-call/111307/2 "2007-08-06T14:20:06Z")

</div>

On 8/5/07, Mike D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
