diff --git a/app/controllers/admin/certificates_controller.rb b/app/controllers/admin/certificates_controller.rb index 389c02f..29a94db 100644 --- a/app/controllers/admin/certificates_controller.rb +++ b/app/controllers/admin/certificates_controller.rb @@ -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 \ No newline at end of file