You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the session to persist data from each step rather than persisting in the DB. This seems to mean I cannot use render_wizard to move from step to step because there is nothing to persist with a save method. Instead, I use jump_to to redirect to the next step after an update.
Example Wizard Controller
class MyWizardController < ApplicationController
include Wicked::Wizard
steps :uno, :dos, :tres
def show
jump_to(steps.first) unless step
render_wizard
end
def update
send(step)
end
private
def uno
session[:test] = params[:test]
jump_to(:dos) # also jump_to next_step
end
def dos
session[:test2] = params[:test2]
jump_to(:tres)
end
end
On the first render, a step is not defined. The jump_to function redirects correctly to the first step's URL /wizard?uno. However, specifying a step to "jump_to" in the update actions, in my case, just re-renders the current step /wizard?uno instead of /wizard?dos.
Manually calling redirect_to redirect_to wizard_path(next_step) || redirect_to(:dos) works.
What am I missing here? Thanks for your help.
The text was updated successfully, but these errors were encountered:
I use the session to persist data from each step rather than persisting in the DB. This seems to mean I cannot use render_wizard to move from step to step because there is nothing to persist with a
save
method. Instead, I use jump_to to redirect to the next step after an update.Example Wizard Controller
On the first render, a step is not defined. The jump_to function redirects correctly to the first step's URL
/wizard?uno
. However, specifying a step to "jump_to" in the update actions, in my case, just re-renders the current step/wizard?uno
instead of/wizard?dos
.Manually calling redirect_to
redirect_to wizard_path(next_step) || redirect_to(:dos)
works.What am I missing here? Thanks for your help.
The text was updated successfully, but these errors were encountered: