From e7a0d13a38e125883933b1f83aba136496c17cad Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 29 Oct 2019 23:13:52 +0800 Subject: [PATCH] Update seminars_controller.rb fix error --- app/controllers/seminars_controller.rb | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/app/controllers/seminars_controller.rb b/app/controllers/seminars_controller.rb index 6f0c8ef..baf931f 100644 --- a/app/controllers/seminars_controller.rb +++ b/app/controllers/seminars_controller.rb @@ -1,7 +1,7 @@ class SeminarsController < ApplicationController helper MemberHelper - include ActionView::Context + include ActionView::Context #vary important (only add this can access @@session from view) include Admin::SeminarsHelper # include SimpleCaptcha::ControllerHelpers def index @@ -204,13 +204,11 @@ class SeminarsController < ApplicationController def add_file - session = OrbitHelper.get_session + if !@@session[:seminar_main_id].blank? - if !session[:seminar_main_id].blank? + seminar = SeminarMain.find_by(id: @@session[:seminar_main_id]) - seminar = SeminarMain.find_by(id: session[:seminar_main_id]) - - seminar_signup = SeminarSignup.find_by(_id: session[:seminar_signup_id], seminar_main_id: session[:seminar_main_id] ) + seminar_signup = SeminarSignup.find_by(_id: @@session[:seminar_signup_id], seminar_main_id: @@session[:seminar_main_id] ) else @@ -245,13 +243,11 @@ class SeminarsController < ApplicationController time_now = Time.now - session = OrbitHelper.get_session + if !@@session[:seminar_main_id].blank? - if !session[:seminar_main_id].blank? + seminar = SeminarMain.find_by(id: @@session[:seminar_main_id]) - seminar = SeminarMain.find_by(id: session[:seminar_main_id]) - - seminar_signup = SeminarSignup.find_by(_id: session[:seminar_signup_id], seminar_main_id: session[:seminar_main_id] ) + seminar_signup = SeminarSignup.find_by(_id: @@session[:seminar_signup_id], seminar_main_id: @@session[:seminar_main_id] ) else