intro params added

This commit is contained in:
Harry Bomrah 2016-03-10 15:40:06 +08:00
parent a2a7efc593
commit ea16bf3c9b
1 changed files with 20 additions and 16 deletions

View File

@ -51,22 +51,6 @@ class Admin::CertificatesController < OrbitMemberController
redirect_to URI.encode('/admin/members/'+@member.to_param+'/Certificate')
end
def set_plugin
@plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'Certificate'}.first
end
def set_certificate
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
@certificate = Certificate.find_by(:uid => uid) rescue Certificate.find(params[:id])
end
def toggle_hide
if params[:ids]
@certificates = Certificate.any_in(_id: params[:ids])
@ -85,4 +69,24 @@ class Admin::CertificatesController < OrbitMemberController
def certificate_params
params.require(:certificate).permit!
end
def intro_params
params.require(:certificate_intro).permit!
end
def set_plugin
@plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'Certificate'}.first
end
def set_certificate
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
@certificate = Certificate.find_by(:uid => uid) rescue Certificate.find(params[:id])
end
end