chinwagsocial/app/controllers/settings/exports_controller.rb

31 lines
547 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class Settings::ExportsController < ApplicationController
include Authorization
layout 'admin'
before_action :authenticate_user!
before_action :set_body_classes
2017-03-20 06:29:41 +11:00
def show
@export = Export.new(current_account)
@backups = current_user.backups
end
def create
authorize :backup, :create?
backup = current_user.backups.create!
BackupWorker.perform_async(backup.id)
redirect_to settings_export_path
2017-03-20 06:29:41 +11:00
end
private
def set_body_classes
@body_classes = 'admin'
end
end