add :edit action
This commit is contained in:
parent
c0383ebff5
commit
3bf16e0419
|
@ -2,9 +2,8 @@ class Admin::ActivitiesController < OrbitMemberController
|
||||||
layout "member_plugin"
|
layout "member_plugin"
|
||||||
#include Admin::PersonalActivitiesHelper
|
#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 :set_plugin
|
||||||
#before_action :get_settings,:only => [:new, :edit, :setting]
|
|
||||||
|
|
||||||
#before_action :need_access_right
|
#before_action :need_access_right
|
||||||
#before_action :allow_admin_only, :only => [:index, :setting]
|
#before_action :allow_admin_only, :only => [:index, :setting]
|
||||||
|
@ -16,4 +15,21 @@ class Admin::ActivitiesController < OrbitMemberController
|
||||||
format.xml { render :xml => @activities }
|
format.xml { render :xml => @activities }
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
Loading…
Reference in New Issue