From 0b4db9775646d0ad32e7d3b789a7cbadc4483702 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 11 Jul 2016 15:15:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index bc764d034..125b2b97e 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -61,7 +61,7 @@ class AdminController < ApplicationController if params[:syllabus_id] && params[:course_id] course = Course.where("id = #{params[:course_id].to_i}").first unless course.nil? - course.update_attribute('syllabus_id', params[:syllabus_id].to_i) + course.update_column('syllabus_id', params[:syllabus_id].to_i) @flag = true end end @@ -124,11 +124,11 @@ class AdminController < ApplicationController end end - #修改课程名称 + #修改班级名称 def update_course_name @course = Course.where("id = #{params[:course_id].to_i}").first unless @course.nil? - @course.update_attribute("name", params[:name]) + @course.update_column("name", params[:name]) respond_to do |format| format.js end