views:

67

answers:

0

I am implementing a wizard like interface which will help a user configure application settings.

I am using the AASM plugin to guide the user from state to state with the ability to go forward or backward through the configuration. I have implemented a skeleton of this core functionality and it is functioning as expected.

The problem I am running into is that I need to repeat one or more of the states several times depending on the number of objects that exist of a certain type.

To explain a little further I have multiple regions each with several sites and each site has multiple wireless networks. So the outer loop would step through each region, the inner loop would step through each site within the first selected region.

Of course in C or JAVA this is a no-brainer, we learned this the second class we took in intro to prog. But with the stateless nature of the web, I can't think of a good way to do this without it being a bit of a hack. I'm currently thinking I'll have two state machines, one for the region, one for the sites, and I can probably use some of the callback functions of AASM to determine if it can move back or not. But I also have to pop out the active record id during the state change, so that I can pull the right record out in the new state.