2016-08-25 12:14:56 -05:00
|
|
|
require_dependency 'wizard'
|
2016-09-09 15:51:07 -05:00
|
|
|
require_dependency 'wizard/builder'
|
2016-08-25 12:14:56 -05:00
|
|
|
|
|
|
|
class WizardController < ApplicationController
|
2016-09-14 15:36:08 -05:00
|
|
|
before_filter :ensure_wizard_enabled, only: [:index]
|
2016-08-25 12:14:56 -05:00
|
|
|
before_filter :ensure_logged_in
|
|
|
|
before_filter :ensure_staff
|
|
|
|
|
|
|
|
skip_before_filter :check_xhr, :preload_json
|
|
|
|
|
|
|
|
layout false
|
|
|
|
|
|
|
|
def index
|
|
|
|
respond_to do |format|
|
|
|
|
format.json do
|
2016-09-09 15:51:07 -05:00
|
|
|
wizard = Wizard::Builder.new(current_user).build
|
2016-08-25 12:14:56 -05:00
|
|
|
render_serialized(wizard, WizardSerializer)
|
|
|
|
end
|
|
|
|
format.html {}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def qunit
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|