From c48ef87479e98e6a46c2f6b9baa24720120b3fea Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 16 Oct 2019 14:47:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=86=E7=8F=AD=E5=92=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=A8=E8=AE=BA=E5=8C=BA=E5=AD=90=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E8=BF=94=E5=9B=9Eid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/boards_controller.rb | 3 +-- app/controllers/course_groups_controller.rb | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 2bcc8d8f6..9d3afc80c 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -20,9 +20,8 @@ class BoardsController < ApplicationController new_board.parent_id = board.try(:id) new_board.position = board.children.count + 1 new_board.save! + render :json => {category_id: new_board.id, status: 0, message: "添加成功"} end - - normal_status(0, "添加成功") end # 子目录的拖动 diff --git a/app/controllers/course_groups_controller.rb b/app/controllers/course_groups_controller.rb index bfdb959b4..42a070734 100644 --- a/app/controllers/course_groups_controller.rb +++ b/app/controllers/course_groups_controller.rb @@ -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