Change: #647 NGワードの入力フォーム (#663)

* Change: #647 NGワードの入力フォーム

* Wip: 画面改造

* テストコード、画面

* Fix: 複数の問題
This commit is contained in:
KMY(雪あすか) 2024-03-26 08:44:16 +09:00 committed by GitHub
parent 0d2b415e26
commit 95ab1f729c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 526 additions and 172 deletions

View file

@ -0,0 +1,30 @@
# frozen_string_literal: true
module Admin
class NgWords::KeywordsController < NgWordsController
def show
super
@ng_words = ::NgWord.caches.presence || [::NgWord.new]
end
protected
def validate
begin
::NgWord.save_from_raws(settings_params_test)
return true
rescue
flash[:alert] = I18n.t('admin.ng_words.test_error')
redirect_to after_update_redirect_path
end
false
end
private
def after_update_redirect_path
admin_ng_words_keywords_path
end
end
end