recruitment/app/controllers/admin/recruitments_controller.rb

77 lines
1.7 KiB
Ruby
Raw Normal View History

2017-12-21 19:41:50 +00:00
class Admin::RecruitmentsController < OrbitAdminController
def index
end
def industries
@industries = RecruitmentIndustry.all
end
def addindustry
@industry = RecruitmentIndustry.new
render :layout => false
end
def createindustry
industry = RecruitmentIndustry.create(industry_params)
redirect_to industries_admin_recruitments_path
end
def editindustry
@industry = RecruitmentIndustry.find(params[:id])
render :layout => false
end
def updateindustry
industry = RecruitmentIndustry.find(params[:id])
industry.update_attributes(industry_params)
redirect_to industries_admin_recruitments_path
end
def deleteindustry
industry = RecruitmentIndustry.find(params[:id])
industry.destroy
redirect_to industries_admin_recruitments_path
end
def categories
@categories = RecruitmentCategory.all
end
def addcategory
@category = RecruitmentCategory.new
render :layout => false
end
def createcategory
category = RecruitmentCategory.create(category_params)
redirect_to categories_admin_recruitments_path
end
def editcategory
@category = RecruitmentCategory.find(params[:id])
render :layout => false
end
def updatecategory
category = RecruitmentCategory.find(params[:id])
category.update_attributes(category_params)
redirect_to categories_admin_recruitments_path
end
def deletecategory
category = RecruitmentCategory.find(params[:id])
category.destroy
redirect_to categories_admin_recruitments_path
end
private
def industry_params
params.require(:recruitment_industry).permit!
end
def category_params
params.require(:recruitment_category).permit!
end
2017-12-21 19:41:50 +00:00
end