|
|
|
@ -9,8 +9,8 @@ class CourseGroupsController < ApplicationController
|
|
|
|
|
if @course.course_groups.where(name: params[:name]).count > 0
|
|
|
|
|
normal_status(-1, "已存在同名分班")
|
|
|
|
|
else
|
|
|
|
|
@course.course_groups.create!(name: params[:name], position: @course.course_groups.count + 1)
|
|
|
|
|
normal_status(0, "创建成功")
|
|
|
|
|
course_group = @course.course_groups.create!(name: params[:name], position: @course.course_groups.count + 1)
|
|
|
|
|
render :json => {group_id: course_group.id, status: 0, message: "创建成功"}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|