Hello
I am trying to set up a user creation wizard where the user can only go to the page that corresponds to the current step in the wizard that the user is on.
I have already sorted out the state machine functionality. The current state is stored in the DB. This is not the problem
The problem is how to redirect the user to the right page.
I first tried a before filter but that resulted in a redirect loop. The solution for this was messy.
The next thing I tried is to use redirect_to to send the request to an action that then redirects to the proper page. This resulted in a DoubleRenderError because I redirect twice. I thought redirect_to was a new http request but it seems it is not.
I am wondering now if it is possible to set up this kind of functionality in the routes directly. I will need to have access to the DB to get the current state. I have no idea how this is done or if it is even possible
Any ideas?
Thank you