fixed 消息模板配置type

This commit is contained in:
“xxq250” 2022-08-10 17:43:27 +08:00
parent 58368277c0
commit c167c39050
1 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@ class Admins::MessageTemplatesController < Admins::BaseController
end
def new
@message_template = MessageTemplate::CustomTip.new
@message_template = MessageTemplate.new
end
def create
@ -47,8 +47,9 @@ class Admins::MessageTemplatesController < Admins::BaseController
private
def message_template_params
type = @message_template.present? ? @message_template.type : "MessageTemplate::CustomTip"
params.require(type.split("::").join("_").underscore.to_sym).permit!
# type = @message_template.present? ? @message_template.type : "MessageTemplate::CustomTip"
# params.require(type.split("::").join("_").underscore.to_sym).permit!
params.require(:message_template).permit!
end
def get_template