You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
547 B

  1. # frozen_string_literal: true
  2. class Settings::ExportsController < ApplicationController
  3. include Authorization
  4. layout 'admin'
  5. before_action :authenticate_user!
  6. before_action :set_body_classes
  7. def show
  8. @export = Export.new(current_account)
  9. @backups = current_user.backups
  10. end
  11. def create
  12. authorize :backup, :create?
  13. backup = current_user.backups.create!
  14. BackupWorker.perform_async(backup.id)
  15. redirect_to settings_export_path
  16. end
  17. private
  18. def set_body_classes
  19. @body_classes = 'admin'
  20. end
  21. end