add site destroy for admin
This commit is contained in:
parent
beeb12c336
commit
890c826685
|
@ -17,6 +17,17 @@ class Admins::SitePagesController < Admins::BaseController
|
||||||
def edit
|
def edit
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
if @site_page.destroy
|
||||||
|
redirect_to admins_site_pages_path
|
||||||
|
flash[:success] = "删除站点成功"
|
||||||
|
else
|
||||||
|
redirect_to admins_site_pages_path
|
||||||
|
flash[:danger] = "删除站点失败"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@site_page.update(update_params)
|
@site_page.update(update_params)
|
||||||
flash[:success] = '保存成功'
|
flash[:success] = '保存成功'
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
<td class="action-container">
|
<td class="action-container">
|
||||||
<%= link_to "查看", edit_admins_site_page_path(site_page), class: 'action' %>
|
<%= link_to "查看", edit_admins_site_page_path(site_page), class: 'action' %>
|
||||||
|
<%= link_to "删除", admins_site_page_path(site_page), method: :delete, data:{confirm: "确认删除吗,删除后站点将无法访问?"}, class: "action" %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue