timaschew-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2009-Jul-31 00:18 UTC
synchron user-request without reloading the site or the controller
Hello, I have a controller which gets some data from a user (through a form) and the it compute the user data and get an result. Depends on the result I want to make a request (for example: a simple popup) and the user type into the popup simple data (some numerary) and then the request return the value back to the controller and the controller can continue computing with the new data (numerary) and generate the end result. At the end the view will be generated with access to the end result. Is this possible to implement an user requst while the controller is computing and before the view will generated? Thanks Timaschew
Frederick Cheung
2009-Jul-31 03:54 UTC
Re: synchron user-request without reloading the site or the controller
On Jul 30, 8:18 pm, "timasc...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" <timasc...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hello, > > I have a controller which gets some data from a user (through a form) > and the it compute the user data and get an result. Depends on the > result I want to make a request (for example: a simple popup) and the > user type into the popup simple data (some numerary) and then the > request return the value back to the controller and the controller can > continue computing with the new data (numerary) and generate the end > result. At the end the view will be generated with access to the end > result. > > Is this possible to implement an user requst while the controller is > computing and before the view will generated? >Not really - that''s just not how web apps wortk in general. Fred> Thanks > Timaschew
Marnen Laibow-Koser
2009-Jul-31 03:55 UTC
Re: synchron user-request without reloading the site or the controller
timaschew-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org [...]> Is this possible to implement an user requst while the controller is > computing and before the view will generated?Not as such, but the functionality you envision is certainly possible. Basically, it works like this: the controller determines (or asks the model to determine) if additional input is needed from the user. If so, it renders one view template; if not, it renders another. The point is that (barring client-side JavaScript) no rendering is possible without involving the view. Nor should it be.> > Thanks > TimaschewBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.