I''ve been talking with some Java programmers who are moving over to Rails. This question often comes up and so I thought I would pose it to the list to see if any of you fine folks have dealt with this before: What methods / plugins / etc are available for controlling the user''s flow through the application? Is there something similar to Spring WebFlows but not as awful to implement? The flow would walk / force a user through a series of pages like a wizard, where the current step would need to be completed before moving on. I''ve seen the acts_as_wizard plugin and it looks good for chaining controllers together... but I don''t see how it could prevent one from skipping ahead, or from invoking one of the individual controllers in the chain. It''s not that difficult to just chain controllers together with redirect and render, but I was just curious to see what others were doing. Thanks in advance! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Brian Hogan wrote:> I''ve been talking with some Java programmers who are moving over to Rails. > This question often comes up and so I thought I would pose it to the list to > see if any of you fine folks have dealt with this before: > > What methods / plugins / etc are available for controlling the user''s flow > through the application? Is there something similar to Spring WebFlows but > not as awful to implement? The flow would walk / force a user through a > series of pages like a wizard, where the current step would need to be > completed before moving on. > > I''ve seen the acts_as_wizard plugin and it looks good for chaining > controllers together... but I don''t see how it could prevent one from > skipping ahead, or from invoking one of the individual controllers in the > chain. > > It''s not that difficult to just chain controllers together with redirect and > render, but I was just curious to see what others were doing. > > Thanks in advance! >I''ve worked up a wizard flow for one of my projects, but haven''t yet had a chance to extract it. It currently leads the user through a multi-step form and basically won''t let them do anything else until they complete the form or cancel the wizard. _Kevin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Brian, If you need complex flow logic in your app you should look at seaside wriiten in Smalltalk. http://seaside.st/ which supports continutaions based backtracking etc. Check out: http://www.iam.unibe.ch/~scg/Archive/Papers/Duca04eSeaside.pdf -bakki On 9/5/06, Brian Hogan <bphogan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve been talking with some Java programmers who are moving over to Rails. > This question often comes up and so I thought I would pose it to the list to > see if any of you fine folks have dealt with this before: > > What methods / plugins / etc are available for controlling the user''s flow > through the application? Is there something similar to Spring WebFlows but > not as awful to implement? The flow would walk / force a user through a > series of pages like a wizard, where the current step would need to be > completed before moving on. > > I''ve seen the acts_as_wizard plugin and it looks good for chaining > controllers together... but I don''t see how it could prevent one from > skipping ahead, or from invoking one of the individual controllers in the > chain. > > It''s not that difficult to just chain controllers together with redirect and > render, but I was just curious to see what others were doing. > > Thanks in advance! > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
@Bakki Kudva That''s nice and all but off-topic. I need to focus on solutions for Rails at this time. It''s definitely interesting reading though.. thanks for sharing. On 9/5/06, Bakki Kudva <bakki.kudva-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi Brian, > > If you need complex flow logic in your app you should look at seaside > wriiten in Smalltalk. http://seaside.st/ which supports continutaions > based backtracking etc. > Check out: > http://www.iam.unibe.ch/~scg/Archive/Papers/Duca04eSeaside.pdf > -bakki > > On 9/5/06, Brian Hogan <bphogan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I''ve been talking with some Java programmers who are moving over to > Rails. > > This question often comes up and so I thought I would pose it to the > list to > > see if any of you fine folks have dealt with this before: > > > > What methods / plugins / etc are available for controlling the user''s > flow > > through the application? Is there something similar to Spring WebFlows > but > > not as awful to implement? The flow would walk / force a user through a > > series of pages like a wizard, where the current step would need to be > > completed before moving on. > > > > I''ve seen the acts_as_wizard plugin and it looks good for chaining > > controllers together... but I don''t see how it could prevent one from > > skipping ahead, or from invoking one of the individual controllers in > the > > chain. > > > > It''s not that difficult to just chain controllers together with redirect > and > > render, but I was just curious to see what others were doing. > > > > Thanks in advance! > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
@Kevin: Please share whatever you can :) I''d love to not have to reinvent the wheel. On 9/5/06, _Kevin <kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > Brian Hogan wrote: > > I''ve been talking with some Java programmers who are moving over to > Rails. > > This question often comes up and so I thought I would pose it to the > list to > > see if any of you fine folks have dealt with this before: > > > > What methods / plugins / etc are available for controlling the user''s > flow > > through the application? Is there something similar to Spring WebFlows > but > > not as awful to implement? The flow would walk / force a user through a > > series of pages like a wizard, where the current step would need to be > > completed before moving on. > > > > I''ve seen the acts_as_wizard plugin and it looks good for chaining > > controllers together... but I don''t see how it could prevent one from > > skipping ahead, or from invoking one of the individual controllers in > the > > chain. > > > > It''s not that difficult to just chain controllers together with redirect > and > > render, but I was just curious to see what others were doing. > > > > Thanks in advance! > > > > I''ve worked up a wizard flow for one of my projects, but haven''t yet > had a chance to extract it. > > It currently leads the user through a multi-step form and basically > won''t let them do anything else until they complete the form or cancel > the wizard. > > _Kevin > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Brian Hogan wrote:> @Kevin: > > Please share whatever you can :) I''d love to not have to reinvent the wheel. > > On 9/5/06, _Kevin <kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > Brian Hogan wrote: > > > I''ve been talking with some Java programmers who are moving over to > > Rails. > > > This question often comes up and so I thought I would pose it to the > > list to > > > see if any of you fine folks have dealt with this before: > > > > > > What methods / plugins / etc are available for controlling the user''s > > flow > > > through the application? Is there something similar to Spring WebFlows > > but > > > not as awful to implement? The flow would walk / force a user through a > > > series of pages like a wizard, where the current step would need to be > > > completed before moving on. > > > > > > I''ve seen the acts_as_wizard plugin and it looks good for chaining > > > controllers together... but I don''t see how it could prevent one from > > > skipping ahead, or from invoking one of the individual controllers in > > the > > > chain. > > > > > > It''s not that difficult to just chain controllers together with redirect > > and > > > render, but I was just curious to see what others were doing. > > > > > > Thanks in advance! > > > > > > > I''ve worked up a wizard flow for one of my projects, but haven''t yet > > had a chance to extract it. > > > > It currently leads the user through a multi-step form and basically > > won''t let them do anything else until they complete the form or cancel > > the wizard. > > > > _Kevin > > > > > > > > > > > ------=_Part_6679_9568412.1157509841281 > Content-Type: text/html; charset=ISO-8859-1 > X-Google-AttachSize: 1808 > > @Kevin:<br><br>Please share whatever you can :) I''d love to not have to reinvent the wheel.<br><br><div><span class="gmail_quote">On 9/5/06, <b class="gmail_sendername">_Kevin</b> <<a href="mailto:kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"> > kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>Brian Hogan wrote:<br>> I''ve been talking with some Java programmers who are moving over to Rails. > <br>> This question often comes up and so I thought I would pose it to the list to<br>> see if any of you fine folks have dealt with this before:<br>><br>> What methods / plugins / etc are available for controlling the user''s flow > <br>> through the application? Is there something similar to Spring WebFlows but<br>> not as awful to implement? The flow would walk / force a user through a<br>> series of pages like a wizard, where the current step would need to be > <br>> completed before moving on.<br>><br>> I''ve seen the acts_as_wizard plugin and it looks good for chaining<br>> controllers together... but I don''t see how it could prevent one from<br>> skipping ahead, or from invoking one of the individual controllers in the > <br>> chain.<br>><br>> It''s not that difficult to just chain controllers together with redirect and<br>> render, but I was just curious to see what others were doing.<br>><br>> Thanks in advance!<br>> > <br><br>I''ve worked up a wizard flow for one of my projects, but haven''t yet<br>had a chance to extract it.<br><br>It currently leads the user through a multi-step form and basically<br>won''t let them do anything else until they complete the form or cancel > <br>the wizard.<br><br>_Kevin<br><br><br></div><br> > > ------=_Part_6679_9568412.1157509841281--Here''s the general structure. Note that this is somewhat specific for my app, so YMMV... 1. Create a Wizard Controller mine defines methods like [''next'',''back'',''cancel'',''finish'',''start'',''index'']. This controller defines the wizard behavior. By doing some case...when statements, you can define the behavior of your wizard. Cancelling or finishing should clear the session[:wizard] hash. 2. create a session hash like session[:wizard] can contain subkeys like [:step, :name] 3. in the Controller you want the wizard to work with... I create a method called ''wizard?'' that intecepts wizard buttons in the params (i.e., looking for params[:back]) and redirects them to the wizard_controller This method also loads any object required by a particular step in the wizard, and then returns true if wizard mode is active (by looking for the presence of session[:wizard] 4. modify the methods in each step as needed to customize it''s behavior in wizard mode. I also redirect my application''s base index method through the Wizard controller index method. It checks to see if a wizard is defined in the session, if so, it redirects the user to the appropriate page to continue the wizard. My particular wizard saves objects as it goes along, but you could probably save stuff in the session and only commit it to the DB on completion of the wizard. _Kevin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Very cool... thanks so much for sharing. On 9/6/06, _Kevin <kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > Brian Hogan wrote: > > @Kevin: > > > > Please share whatever you can :) I''d love to not have to reinvent the > wheel. > > > > On 9/5/06, _Kevin <kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > Brian Hogan wrote: > > > > I''ve been talking with some Java programmers who are moving over to > > > Rails. > > > > This question often comes up and so I thought I would pose it to the > > > list to > > > > see if any of you fine folks have dealt with this before: > > > > > > > > What methods / plugins / etc are available for controlling the > user''s > > > flow > > > > through the application? Is there something similar to Spring > WebFlows > > > but > > > > not as awful to implement? The flow would walk / force a user > through a > > > > series of pages like a wizard, where the current step would need to > be > > > > completed before moving on. > > > > > > > > I''ve seen the acts_as_wizard plugin and it looks good for chaining > > > > controllers together... but I don''t see how it could prevent one > from > > > > skipping ahead, or from invoking one of the individual controllers > in > > > the > > > > chain. > > > > > > > > It''s not that difficult to just chain controllers together with > redirect > > > and > > > > render, but I was just curious to see what others were doing. > > > > > > > > Thanks in advance! > > > > > > > > > > I''ve worked up a wizard flow for one of my projects, but haven''t yet > > > had a chance to extract it. > > > > > > It currently leads the user through a multi-step form and basically > > > won''t let them do anything else until they complete the form or cancel > > > the wizard. > > > > > > _Kevin > > > > > > > > > > > > > > > > > ------=_Part_6679_9568412.1157509841281 > > Content-Type: text/html; charset=ISO-8859-1 > > X-Google-AttachSize: 1808 > > > > @Kevin:<br><br>Please share whatever you can :) I''d love to not have to > reinvent the wheel.<br><br><div><span class="gmail_quote">On 9/5/06, <b > class="gmail_sendername">_Kevin</b> <<a href="mailto: > kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"> > > kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:</span><blockquote > class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); > margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>Brian Hogan > wrote:<br>> I''ve been talking with some Java programmers who are moving > over to Rails. > > <br>> This question often comes up and so I thought I would pose it > to the list to<br>> see if any of you fine folks have dealt with this > before:<br>><br>> What methods / plugins / etc are available for > controlling the user''s flow > > <br>> through the application? Is there something similar to Spring > WebFlows but<br>> not as awful to implement? The flow would walk / force > a user through a<br>> series of pages like a wizard, where the current > step would need to be > > <br>> completed before moving on.<br>><br>> I''ve seen the > acts_as_wizard plugin and it looks good for chaining<br>> controllers > together... but I don''t see how it could prevent one from<br>> skipping > ahead, or from invoking one of the individual controllers in the > > <br>> chain.<br>><br>> It''s not that difficult to just chain > controllers together with redirect and<br>> render, but I was just > curious to see what others were doing.<br>><br>> Thanks in > advance!<br>> > > <br><br>I''ve worked up a wizard flow for one of my projects, but haven''t > yet<br>had a chance to extract it.<br><br>It currently leads the user > through a multi-step form and basically<br>won''t let them do anything else > until they complete the form or cancel > > <br>the wizard.<br><br>_Kevin<br><br><br></div><br> > > > > ------=_Part_6679_9568412.1157509841281-- > > Here''s the general structure. Note that this is somewhat specific for > my app, so YMMV... > > 1. Create a Wizard Controller > > mine defines methods like > [''next'',''back'',''cancel'',''finish'',''start'',''index'']. > This controller defines the wizard behavior. By doing some case...when > statements, you can define the behavior of your wizard. Cancelling or > finishing should clear the session[:wizard] hash. > > 2. create a session hash like session[:wizard] > can contain subkeys like [:step, :name] > > 3. in the Controller you want the wizard to work with... > I create a method called ''wizard?'' that intecepts wizard buttons in the > params (i.e., looking for params[:back]) and redirects them to the > wizard_controller > > This method also loads any object required by a particular step in the > wizard, and then returns true if wizard mode is active (by looking for > the presence of session[:wizard] > > 4. modify the methods in each step as needed to customize it''s behavior > in wizard mode. > > I also redirect my application''s base index method through the Wizard > controller index method. It checks to see if a wizard is defined in > the session, if so, it redirects the user to the appropriate page to > continue the wizard. > > My particular wizard saves objects as it goes along, but you could > probably save stuff in the session and only commit it to the DB on > completion of the wizard. > > _Kevin > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---