international_recruit/app/controllers/admin/international_recruits_cont...

51 lines
1.3 KiB
Ruby
Raw Normal View History

2017-09-21 12:53:58 +00:00
class Admin::InternationalRecruitsController < OrbitAdminController
def index
@table_fields = ["international_recruit.member_name", "international_recruit.submited_date", "international_recruit.actions"]
@applications = RecruitApplication.all.desc(:created_at).page(params[:page]).per(10)
end
def destroy
ra = RecruitApplication.find(params[:id])
ra.destroy
redirect_to admin_international_recruits_path
end
2017-09-21 16:13:22 +00:00
def add_course
@course = UniversityCourse.new
end
def create_course
course = UniversityCourse.new(course_params)
course.save
redirect_to courses_admin_international_recruits_path
end
def edit_course
@course = UniversityCourse.find(params[:id])
end
def update_course
course = UniversityCourse.find(params[:id])
course.update_attributes(course_params)
course.save
redirect_to courses_admin_international_recruits_path
end
def courses
@table_fields = ["international_recruit.course_name", "international_recruit.actions"]
@courses = UniversityCourse.all.asc(:created_at)
end
2017-09-21 16:13:22 +00:00
def delete_course
course = UniversityCourse.find(params[:id])
course.destroy
redirect_to courses_admin_international_recruits_path
end
private
def course_params
params.require(:university_course).permit!
end
2017-09-21 12:53:58 +00:00
end