wizard.rb 599 B

1234567891011121314151617181920
  1. class CustomWizard::WizardController < ::ApplicationController
  2. prepend_view_path(Rails.root.join('plugins', 'discourse-custom-wizard', 'views'))
  3. layout 'wizard'
  4. helper_method :wizard_page_title
  5. def wizard_page_title
  6. wizard = PluginStore.get('custom_wizard', params[:wizard_id].underscore)
  7. wizard['name'] || wizard['id']
  8. end
  9. def index
  10. respond_to do |format|
  11. format.json do
  12. wizard = CustomWizard::Builder.new(current_user, params[:wizard_id].underscore).build
  13. render_serialized(wizard, WizardSerializer)
  14. end
  15. format.html {}
  16. end
  17. end
  18. end