Render layout to import the subjects.
# File app/controllers/admin/subjects_controller.rb, line 6 def import render :layout => false end
Import csv file for subjects and save it in database.
# File app/controllers/admin/subjects_controller.rb, line 11 def import_csv if params[:file].present? Subject.dump_into_database(params[:file]) redirect_to admin_subjects_path, notice: "File imported Successfully." else redirect_to admin_subjects_path end end
Render layout to import the courses.
# File app/controllers/admin/subjects_controller.rb, line 21 def import_courses render :layout => false end
Import csv file for courses and save it in database.
# File app/controllers/admin/subjects_controller.rb, line 26 def import_courses_csv if params[:file].present? Subject.insert_courses_data_into_database(params[:file]) redirect_to admin_subjects_path, notice: "File imported Successfully." else redirect_to admin_subjects_path end end