班级动态

This commit is contained in:
cxt 2016-07-11 15:15:38 +08:00
parent c7bb53d2bd
commit 0b4db97756
1 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ class AdminController < ApplicationController
if params[:syllabus_id] && params[:course_id] if params[:syllabus_id] && params[:course_id]
course = Course.where("id = #{params[:course_id].to_i}").first course = Course.where("id = #{params[:course_id].to_i}").first
unless course.nil? 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 @flag = true
end end
end end
@ -124,11 +124,11 @@ class AdminController < ApplicationController
end end
end end
#修改课程名称 #修改班级名称
def update_course_name def update_course_name
@course = Course.where("id = #{params[:course_id].to_i}").first @course = Course.where("id = #{params[:course_id].to_i}").first
unless @course.nil? unless @course.nil?
@course.update_attribute("name", params[:name]) @course.update_column("name", params[:name])
respond_to do |format| respond_to do |format|
format.js format.js
end end