From: Kaspar Schiess Date: 2004-05-08T05:39:00+09:00 Subject: Re: What is Borges? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Carl Youngblood wrote: | Is that always good? What if it means the users ends up clicking on the | purchase button twice and we charge their card twice? I've always | thought that it was best not to let the user use the back button in | cases like these (i.e., forward them to the right page, display an error | indicating that the posted values are stale, or something like that). Well, this is actually a problem that has been given some thought. And thus not a problem. In Borges, you would wrap the sequence of your checkout steps with: session.isolate do show_checkout_step_1 show_checkout_step_2 # etc.. end The effect of this is that you get a UI Transaction that protects your checkout steps. Once the user enters the transaction, he can 'back' and 'forth' at will withhin the transaction. But once the final button for checkout is hit, the transaction will be closed and the user can't go back - all he gets is a redirection to the current page of the application. I think that declaring the back button as forbidden is a bad idea, rather make it work the way we expect it to ! There is also a session.once do show_some_unique_timedependent_info show_some_other_stuff end that permits to step trough the sequence just *once*. You might want to download and install Borges and run the following script on your machine for happy testing of these features (and uh admire the nice implementation we have ;) ) require 'Borges' require 'Borges/Test' require 'Borges/WEBrick' Borges::WEBrickServlet.start Then make a connection to localhost:7000/borges/test. I am talking about ~ the Once and the Transaction tab (whoa check out the tab control while your at it). The documentation at www.tua.ch/ruby is rather bad I fear; I will hopefully get to write a full introduction that also explains the concepts a bit more in depth. - -- kaspar semantics & semiotics code manufacture www.tua.ch/ruby -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFAm/ScFifl4CA0ImQRAp1mAJ4lGlf8PCC/A59IMYJOL51Dk9jjCACeMc1O B3unkr2dluf4Wm9J/Y1L/Mw= =q09B -----END PGP SIGNATURE-----