|
|
|
@ -1129,7 +1129,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
def validate_course_name
|
|
|
|
|
tip_exception("课堂名称不能为空!") if params[:course][:name].blank?
|
|
|
|
|
if params[:subject_id].blank? || (@course && @course.subject.blank?)
|
|
|
|
|
if params[:subject_id].blank? && @course.blank? || (@course && @course.subject.blank?)
|
|
|
|
|
tip_exception("课程名称不能为空!") if params[:course_list_name].blank?
|
|
|
|
|
tip_exception("课堂名称应以课程名称开头命名") unless params[:course][:name].index(params[:course_list_name]) &&
|
|
|
|
|
params[:course][:name].index(params[:course_list_name]) == 0
|
|
|
|
|