Add: プレビューカード、参照のフェッチを行わないドメインの設定 ()

This commit is contained in:
KMY(雪あすか) 2024-04-03 12:37:18 +09:00 committed by GitHub
parent ff2860d0df
commit d89e1114bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 123 additions and 2 deletions
app/controllers/admin

View file

@ -0,0 +1,34 @@
# frozen_string_literal: true
module Admin
class SpecialDomainsController < BaseController
def show
authorize :instance, :show?
@admin_settings = Form::AdminSettings.new
end
def create
authorize :instance, :destroy?
@admin_settings = Form::AdminSettings.new(settings_params)
if @admin_settings.save
flash[:notice] = I18n.t('generic.changes_saved_msg')
redirect_to after_update_redirect_path
else
render :show
end
end
private
def after_update_redirect_path
admin_special_domains_path
end
def settings_params
params.require(:form_admin_settings).permit(*Form::AdminSettings::KEYS)
end
end
end