Get a specific controller's wizard steps
itmart opened this issue · comments
Matthew Vo commented
I have two wizard controllers right now. Let's say one of them looks like this:
class MyController < ApplicationController
include Wicked::Wizard
steps :wash, :rinse, :dry
I'm in a model and want to access the steps in MyController
, is there a way to? I've tried MyController.new.wizard_steps
, MyController.steps
, MyController::wizard_steps
but nothing seems to work.
Richard Schneeman commented
The best way i've seen is to define them in a constant somewhere
class MyController < ApplicationController
MY_STEPS = [:wash, :rinse, :dry]
include Wicked::Wizard
steps MY_STEPS
Then you can access it via MyController::MY_STEPS
.