diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 12852c63d..e79ca2caa 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -261,6 +261,25 @@ class CoursesController < ApplicationController @membercount = @members.count @course_groups = @course.course_groups end + + def valid_ajax + req = Hash.new(false) + req[:message] = '' + + valid_attr = params[:valid] + valid_value = params[:value] + + faker = CourseGroup.new + + if valid_attr.eql?('name') + faker.name = valid_value + faker.valid? + req[:valid] = faker.errors[:name].blank? + req[:message] = faker.errors[:name] + end + req[:message] = l(:modal_valid_passing) if req[:message].blank? + render :json => req + end def join_group @subPage_title = l :label_student_list group = CourseGroup.find(params[:object_id]) diff --git a/app/views/courses/member.html.erb b/app/views/courses/member.html.erb index b426e4a3e..ab95f5fdc 100644 --- a/app/views/courses/member.html.erb +++ b/app/views/courses/member.html.erb @@ -1,3 +1,22 @@ +