Class: Stall::Checkout::StepsController
Instance Method Summary
collapse
#available_shipping_methods_for, #step_path
Instance Method Details
#change ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'app/controllers/stall/checkout/steps_controller.rb', line 28
def change
target_step = params[:step]
if @wizard.step_complete?(target_step)
@wizard.move_to_step!(target_step)
redirect_to step_path
else
@step.prepare
flash[:error] ||= t("stall.checkout.#{ target_step }.error")
render 'show'
end
end
|
#show ⇒ Object
11
12
13
|
# File 'app/controllers/stall/checkout/steps_controller.rb', line 11
def show
@step.prepare
end
|
#update ⇒ Object
Also known as:
foreign_update
15
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/stall/checkout/steps_controller.rb', line 15
def update
if @step.process
@wizard.validate_current_step!
redirect_to step_path
else
@step.prepare
flash[:error] ||= t("stall.checkout.#{ @wizard.current_step_name }.error")
render 'show'
end
end
|