add :edit action

This commit is contained in:
EricTYL 2020-02-05 15:09:24 +08:00
parent c0383ebff5
commit 3bf16e0419
1 changed files with 18 additions and 2 deletions

View File

@ -2,9 +2,8 @@ class Admin::ActivitiesController < OrbitMemberController
layout "member_plugin"
#include Admin::PersonalActivitiesHelper
#before_action :set_writing_conference, only: [:show, :edit , :update, :destroy]
before_action :set_activity, only: [:edit]
#before_action :set_plugin
#before_action :get_settings,:only => [:new, :edit, :setting]
#before_action :need_access_right
#before_action :allow_admin_only, :only => [:index, :setting]
@ -16,4 +15,21 @@ class Admin::ActivitiesController < OrbitMemberController
format.xml { render :xml => @activities }
end
end
def edit
end
private
def set_activity
path = request.path.split('/')
if path.last.include? '-'
uid = path[-1].split("-").last
uid = uid.split("?").first
else
uid = path[-2].split("-").last
uid = uid.split("?").first
end
@activity = Activity.find_by(:uid => uid) rescue Activity.find(params[:id])
end
end