diff --git a/app/controllers/course_videos_controller.rb b/app/controllers/course_videos_controller.rb index 0d5a3e460..090c7e29a 100644 --- a/app/controllers/course_videos_controller.rb +++ b/app/controllers/course_videos_controller.rb @@ -8,7 +8,8 @@ class CourseVideosController < ApplicationController def create title = params[:name].strip link = params[:link].strip - @course.course_videos.create!(title: title, link: link, is_link: 1, user_id: current_user.id) + course_second_category_id = params[:category_id] || 0 + @course.course_videos.create!(title: title, link: link, is_link: 1, user_id: current_user.id, course_second_category_id: course_second_category_id) render_ok end diff --git a/app/views/files/index.json.jbuilder b/app/views/files/index.json.jbuilder index 0002cf299..3ae2ec950 100644 --- a/app/views/files/index.json.jbuilder +++ b/app/views/files/index.json.jbuilder @@ -1,4 +1,4 @@ -json.partial! "commons/success" +# json.partial! "commons/success" json.data do json.id @category_id json.name @category_name diff --git a/app/views/weapps/attendances/_student_attendance.json.jbuilder b/app/views/weapps/attendances/_student_attendance.json.jbuilder index 9461c4976..6fd5e9d70 100644 --- a/app/views/weapps/attendances/_student_attendance.json.jbuilder +++ b/app/views/weapps/attendances/_student_attendance.json.jbuilder @@ -1,4 +1,4 @@ -json.(attendance, :name, :mode) +json.(attendance, :id, :name, :mode) json.attendance_date attendance.attendance_date.strftime("%Y/%m/%d") json.start_time attendance.start_time.strftime("%H:%M") json.end_time attendance.end_time.strftime("%H:%M")