1
0
Fork 0
discourse-custom-wizard-unl.../controllers/custom_wizard/admin/admin.rb
2020-11-03 11:28:45 +11:00

18 Zeilen
Kein EOL
452 B
Ruby

class CustomWizard::AdminController < ::Admin::AdminController
before_action :ensure_admin
def index
end
private
def find_wizard
params.require(:wizard_id)
@wizard = CustomWizard::Wizard.create(params[:wizard_id].underscore)
raise Discourse::InvalidParameters.new(:wizard_id) unless @wizard
end
def custom_field_list
serialize_data(CustomWizard::CustomField.list, CustomWizard::CustomFieldSerializer)
end
end