Hi Michael, I think we're agreeing with each other? Delete at the DB, then delete locally when that's been confirmed, right? (And if the confirmation doesn't come back, do all those error-condition things that we omit from these sorts of examples.)
Cheers, Dave On Friday 18 May 2007 14:18, Michael Peters wrote: > Dave Crane wrote: > > On Thursday 17 May 2007 20:59, Jesse Farmer wrote: > >> Similarly you could do the Ajax stuff first and use the onComplete or > >> onSuccess callbacks to then invoke the effect. > > > > I'd strongly advise this. If you delete the element locally, and then > > send a request back to the server to delete from the DB, you run the risk > > of the request failing, and your UI getting out of synch. > > No, his advice is still valid, you just need to switch your steps. Send the > request to delete it and when you get the response back and everything's > good, then you delete it locally. -- ---------------------- Author Ajax in Action http://manning.com/crane Ajax in Practice http://manning.com/crane2 Prototype & Scriptaculous in Action http://manning.com/crane3 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" 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-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
