exports_controller.rb 444 B

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