I have a bit of a complicated wizard and I'd like to route the user based on their entries to the form.
I have listed the steps as follows:
steps :weight_loss_history, :health_conditions, :cancer, :weight_mindset, :diabetes, :diet_information, :heart, :food_intake
...and my update and routing functions are as follows:
def update
@remote = current_remote
params[:remote][:step] = step
atts = Remote.fix_attributes(params[:remote])
@remote.attributes = atts # equal to large hash of params
find_route(@remote)
end
def find_route(info)
if info[:cancer]
puts "cancer..." # I never see this in the console
jump_to(:cancer)
else
render_wizard info
end
end
Does anyone have a good implementation of using Wicked to route users based on their choices?