You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
488 B
19 lines
488 B
class Ecs::EcMajorsController < Ecs::BaseController
|
|
def index
|
|
@major_ids = current_school.ec_major_schools.pluck(:ec_major_id) #学校已选择的专业
|
|
ec_majors = EcMajor.all
|
|
|
|
if params[:search].present?
|
|
ec_majors = ec_majors.search_name_or_code(params[:search])
|
|
end
|
|
|
|
@count = ec_majors.count
|
|
@ec_majors = paginate(ec_majors)
|
|
end
|
|
|
|
private
|
|
|
|
def current_school
|
|
@_current_school ||= School.find(params[:school_id])
|
|
end
|
|
end |