I''m trying to figure out how to best allow a user to click a link_to_remote (or something like it) that will make the clicked thing disappear and replace it with a "Saving..." or "Please wait..." image until the server round-trip is complete. Once complete, it needs to replace the HTML in that span or div with text from the server. I imagine it will involve linking to a javascript function that can set it to not display the current image and show the "Please wait..." graphic. But then getting the AJAX call made from there has me stumped. Anyone able to enlighten me on this? -Mark E.
Marco Lazzeri
2006-Jul-07 15:58 UTC
[Rails] Re: Ajax "Waiting..." flash while round-tripping
Mark Spamfre <mnmfactory@...> writes:> I''m trying to figure out how to best allow a user to click a > link_to_remote (or something like it) that will make the clicked thing > disappear and replace it with a "Saving..." or "Please wait..." image > until the server round-trip is complete. Once complete, it needs to > replace the HTML in that span or div with text from the server.What about the :loading option? http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M000412 Cheers, Marco
Mark Spamfre
2006-Jul-07 16:09 UTC
[Rails] Re: Ajax "Waiting..." flash while round-tripping
Marco Lazzeri wrote:> Mark Spamfre <mnmfactory@...> writes: > >> I''m trying to figure out how to best allow a user to click a >> link_to_remote (or something like it) that will make the clicked thing >> disappear and replace it with a "Saving..." or "Please wait..." image >> until the server round-trip is complete. Once complete, it needs to >> replace the HTML in that span or div with text from the server. >> > > What about the :loading option? > http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M000412 > >That may be perfect! I didn''t know about that. Thanks! -Mark E.