mirror of https://github.com/docusealco/docuseal
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.
29 lines
634 B
29 lines
634 B
# frozen_string_literal: true
|
|
|
|
class AccountLogoController < ApplicationController
|
|
before_action :load_account
|
|
authorize_resource :account
|
|
|
|
def create
|
|
file = params[:logo]
|
|
|
|
return redirect_to settings_personalization_path, alert: I18n.t('unable_to_upload_logo') if file.blank?
|
|
|
|
current_account.logo.attach(file)
|
|
|
|
redirect_to settings_personalization_path, notice: I18n.t('logo_has_been_saved')
|
|
end
|
|
|
|
def destroy
|
|
current_account.logo.purge
|
|
|
|
redirect_to settings_personalization_path, notice: I18n.t('logo_has_been_removed')
|
|
end
|
|
|
|
private
|
|
|
|
def load_account
|
|
@account = current_account
|
|
end
|
|
end
|