add admin :destroy

This commit is contained in:
EricTYL 2020-02-06 13:50:02 +08:00
parent 43a70af1be
commit 2ce3a4d5b6
2 changed files with 11 additions and 1 deletions

View File

@ -2,7 +2,7 @@ class Admin::ActivitiesController < OrbitMemberController
layout "member_plugin" layout "member_plugin"
#include Admin::PersonalActivitiesHelper #include Admin::PersonalActivitiesHelper
before_action :set_activity, only: [:edit, :update] before_action :set_activity, only: [:edit, :update, :destroy]
#before_action :set_plugin #before_action :set_plugin
#before_action :need_access_right #before_action :need_access_right
@ -41,6 +41,15 @@ class Admin::ActivitiesController < OrbitMemberController
redirect_to params['referer_url'] redirect_to params['referer_url']
end end
def destroy
@activity.destroy
respond_to do |format|
format.html { redirect_to(admin_activities_url) }
format.js
format.json { render json: { "success" => true } }
end
end
private private
def set_activity def set_activity

View File

@ -0,0 +1 @@
$("#<%= dom_id @activity %>").remove();