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
If I have a Wizard controller where there is a function for AJAX calls that aren't directly related to the main Wizard steps, the Wizard steps seem to become jumbled. The essence of my Wizard controller is pasted at the bottom.
Two user paths to 'jumble' the step state machine:
User is on step1 and triggers a call to do_something_ajax( ). User refreshes the step1 page with F5. Wizard sends a 302 and redirects the user to step2.
User is on step1 and triggers a call to do_something_ajax( ). User submits form to move to step2. User then navigates 'back' in the browser. Step1 creates a 302 and redirects user back to step2.
Neither of the behaviors are as I would expect. I don't expect a call to do_something_ajax( ) to increment the Wizard steps. If the user does not generate any calls to do_something_ajax( ), everything works as expected.
Am I doing something wrong, or is this a bug with Wizard?
Thanks in advance!
class CheckoutController < ApplicationController
include Wicked::Wizard
steps :step1, :step2, :step3
def do_something_ajax
@checkout.something_happened = true
respond_to do |format|
format.js
end
end
def new
@checkout = Checkout.create( user: current_user )
redirect_to checkout_path( @checkout ) # this ends up being step1 of the wizard
end
def show
case step
when :step1
when :step2
when :step3
end
def update
case step
when :step1
when :step2
when :step3
end
end
The text was updated successfully, but these errors were encountered:
If I have a Wizard controller where there is a function for AJAX calls that aren't directly related to the main Wizard steps, the Wizard steps seem to become jumbled. The essence of my Wizard controller is pasted at the bottom.
Two user paths to 'jumble' the step state machine:
User is on step1 and triggers a call to do_something_ajax( ). User refreshes the step1 page with F5. Wizard sends a 302 and redirects the user to step2.
User is on step1 and triggers a call to do_something_ajax( ). User submits form to move to step2. User then navigates 'back' in the browser. Step1 creates a 302 and redirects user back to step2.
Neither of the behaviors are as I would expect. I don't expect a call to do_something_ajax( ) to increment the Wizard steps. If the user does not generate any calls to do_something_ajax( ), everything works as expected.
Am I doing something wrong, or is this a bug with Wizard?
Thanks in advance!
The text was updated successfully, but these errors were encountered: