zombocom / wicked

Use wicked to turn your controller into a wizard

Home Page:http://schneems.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get a specific controller's wizard steps

itmart opened this issue · comments

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.

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.