Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove redirect for setup wazard #301

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/wicked/wizard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ def wizard_value(step_name)
@wicked_redirect_params = nil
end

private def check_redirect_to_first_last!(step)
redirect_to wizard_path(steps.first) if step.to_s == Wicked::FIRST_STEP
redirect_to wizard_path(steps.last) if step.to_s == Wicked::LAST_STEP
private def check_first_last_step!(step)
return steps.first if step.to_s == Wicked::FIRST_STEP
return steps.last if step.to_s == Wicked::LAST_STEP
return step
end

private def setup_step_from(the_step)
return if steps.nil?

the_step ||= steps.first
check_redirect_to_first_last!(the_step)
the_step = check_first_last_step!(the_step)

valid_steps = steps + self.class::PROTECTED_STEPS
resolved_step = valid_steps.detect { |stp| stp.to_s == the_step }
Expand Down
Loading