mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-21 20:25:45 +08:00
Merge pull request '为建站主题配置增加删除限制' (#126) from KingChan/forgeplus:chenjing into standalone_develop
This commit is contained in:
@@ -30,6 +30,11 @@ class Admins::PageThemesController < Admins::BaseController
|
||||
end
|
||||
|
||||
def destroy
|
||||
if PageTheme.where(language_frame: @page_theme.language_frame).count <= 1
|
||||
flash[:danger] = "删除主题失败,必须存在一个主题"
|
||||
return redirect_to admins_page_themes_path
|
||||
end
|
||||
|
||||
if @page_theme.destroy
|
||||
redirect_to admins_page_themes_path
|
||||
flash[:success] = "删除主题成功"
|
||||
|
||||
Reference in New Issue
Block a user