2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-26 01:14:56 +08:00
|
|
|
class WizardController < ApplicationController
|
2022-06-17 20:50:21 +08:00
|
|
|
requires_login
|
2018-02-01 12:17:59 +08:00
|
|
|
|
2022-06-17 20:50:21 +08:00
|
|
|
before_action :ensure_admin
|
|
|
|
before_action :ensure_wizard_enabled
|
2016-08-26 01:14:56 +08:00
|
|
|
|
|
|
|
def index
|
|
|
|
respond_to do |format|
|
|
|
|
format.json do
|
2016-09-10 04:51:07 +08:00
|
|
|
wizard = Wizard::Builder.new(current_user).build
|
2016-08-26 01:14:56 +08:00
|
|
|
render_serialized(wizard, WizardSerializer)
|
|
|
|
end
|
|
|
|
|
2022-06-17 20:50:21 +08:00
|
|
|
format.html { render body: nil }
|
|
|
|
end
|
2016-08-26 01:14:56 +08:00
|
|
|
end
|
|
|
|
end
|