fix: system notification edit error

This commit is contained in:
yystopf 2021-10-13 17:13:57 +08:00
parent 1b87a7a733
commit 0d60e58304
5 changed files with 10 additions and 5 deletions

View File

@ -33,7 +33,6 @@ class Admins::SystemNotificationsController < Admins::BaseController
end
def update
respond_to do |format|
if @notification.update_attributes(notification_params)
format.html do

View File

@ -5,7 +5,8 @@
# id :integer not null, primary key
# subject :string(255)
# sub_subject :string(255)
# content :string(255)
# content :text(65535)
# is_top :boolean
# created_at :datetime not null
# updated_at :datetime not null
#

View File

@ -1,6 +1,6 @@
<div class="box search-form-container project-list-form">
<div style="line-height: 38px;" class="flex-1"><%= type == "create" ? "新建" : "编辑" %>忽略文件</div>
<%= link_to "返回", admins_project_ignores_path, class: "btn btn-default pull-right" %>
<div style="line-height: 38px;" class="flex-1"><%= type == "create" ? "新建" : "编辑" %>系统通知</div>
<%= link_to "返回", admins_system_notifications_path, class: "btn btn-default pull-right" %>
</div>
<div class="box">

View File

@ -1,2 +1,2 @@
$("#admins-system-notification-content").html("<%= j render(partial: 'admins/system_notifications/form', locals: {type: 'create'}) %>")
$("#admins-system-notification-content").html("<%= j render(partial: 'admins/system_notifications/form', locals: {type: 'update'}) %>")
createMDEditor('system-notification-content-editor', { height: 500, placeholder: '请输入邮件模版' });

View File

@ -0,0 +1,5 @@
class ChangeSystemNotificationContentColumn < ActiveRecord::Migration[5.2]
def change
change_column :system_notifications, :content, :text
end
end