fix bugs in version 1
This commit is contained in:
parent
91c018dabf
commit
52c2e92da2
|
@ -22,7 +22,7 @@ class Admin::OlympiamanagementsController < OrbitAdminController
|
||||||
@students = OlympiaStudentDataField.where(:sign_up_setting_id=>@sign_up_setting.id)
|
@students = OlympiaStudentDataField.where(:sign_up_setting_id=>@sign_up_setting.id)
|
||||||
@error_msg = []
|
@error_msg = []
|
||||||
if @students.length !=0
|
if @students.length !=0
|
||||||
@students.destroy_all
|
@students.destroy
|
||||||
@error_msg << ((I18n.locale.to_s == "zh_tw") ? "已刪除#{@students.length}筆學生資料" : "Already delete #{@students.length} student data.")
|
@error_msg << ((I18n.locale.to_s == "zh_tw") ? "已刪除#{@students.length}筆學生資料" : "Already delete #{@students.length} student data.")
|
||||||
else
|
else
|
||||||
@error_msg << ((I18n.locale.to_s == "zh_tw") ? "尚無學生資料" : "There is no student data yet.")
|
@error_msg << ((I18n.locale.to_s == "zh_tw") ? "尚無學生資料" : "There is no student data yet.")
|
||||||
|
@ -325,7 +325,7 @@ class Admin::OlympiamanagementsController < OrbitAdminController
|
||||||
@student_fields = OlympiaStudentDataField.where(:olympia_school_data_fields_id=>params[:olympia_school_id],:sign_up_setting_id=>@sign_up_setting_id).asc(:id).page(page_num).per(10)
|
@student_fields = OlympiaStudentDataField.where(:olympia_school_data_fields_id=>params[:olympia_school_id],:sign_up_setting_id=>@sign_up_setting_id).asc(:id).page(page_num).per(10)
|
||||||
end
|
end
|
||||||
def export_sign_up_student_data
|
def export_sign_up_student_data
|
||||||
@student_data_fields = OlympiaStudentDataField.all.asc(:id)
|
@student_data_fields = OlympiaStudentDataField.where(:sign_up_setting_id=>@sign_up_setting.id).asc(:id)
|
||||||
dir_path = 'tmp/olypiamanagement/'
|
dir_path = 'tmp/olypiamanagement/'
|
||||||
#FileUtils.rm_r(dir_path, :force => true) if Dir.exist?(dir_path)
|
#FileUtils.rm_r(dir_path, :force => true) if Dir.exist?(dir_path)
|
||||||
FileUtils.mkdir dir_path if !Dir.exist?(dir_path) #create dir for storing tmp_file if dir doesn't exist
|
FileUtils.mkdir dir_path if !Dir.exist?(dir_path) #create dir for storing tmp_file if dir doesn't exist
|
||||||
|
|
Loading…
Reference in New Issue