On 8/5/07, Mike Dershowitz
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> 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?
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:
<div id="notice"><%=h flash[:notice] %></div>
Then you would do this:
render :update do |page|
page[:notice].replace_html "insert message here"
end
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---