Topic: stateful conversation and rails

Hi Guys/Gals
This is my first post here as I've been evaluating rails for a little while.  I really like what I see so far but the hardest adjustment that I have coming from other popular web frameworks such as asp.net and jsf is not having stateful components. 

I realize this isn't such a big deal as long as you always sync your changes with the model/database upon every request but what happens if you don't want to do any persistence until after a series of requests (such as a wizard) are completed?  Arguably this sort of thing could all be done on the client and then submitted to the server when the steps are completed but that would require me learning javascript and I'm lazy.  :-)  Asp.net has a conversational abstraction called the view state where by things written to it are serialized in a hidden form field and sent back to the server on each subsequent request of the same form.  This is the concept that stateful components are built on in asp.net.  I realize that rails does have a concept of components but I'm reading the Dave Thomas book and he says that components are falling out of favor with the rails community and are likely to be pulled from the core distribution in a future release.  Therefore I don't really even want to learn them. 

So my question is how do you all handle situations like this?  Is there some feature of rails that I just haven't discovered yet or am I just going to have to change the way I think about building conversational web apps? 

Thanks!

Re: stateful conversation and rails

jnesbitt wrote:

Asp.net has a conversational abstraction called the view state where by things written to it are serialized in a hidden form field and sent back to the server on each subsequent request of the same form.  This is the concept that stateful components are built on in asp.net.  I realize that rails does have a concept of components but I'm reading the Dave Thomas book and he says that components are falling out of favor with the rails community and are likely to be pulled from the core distribution in a future release.

The components the book is referring to are not the same thing. Components in Rails don't have anything to do with forms, it is just a way to render a controller aciton inside of another view (almost like a partial).

jnesbitt wrote:

So my question is how do you all handle situations like this?  Is there some feature of rails that I just haven't discovered yet or am I just going to have to change the way I think about building conversational web apps?

Rails doesn't help too much when it comes to a wizard-like forum. You can do a search for "multipage form" on these forums for some ways to do it.

Partly why Rails does not help here is there are many ways to do them. For example, validation could be handled in many different ways - at the end of the entire process, at the end of each step, etc. The job of this is much better left to a plugin. I think there already is one out there (acts_as_wizard) but I haven't tried it.

Railscasts - Free Ruby on Rails Screencasts