Sha256: d385e5995d26204cccdba7b510126e96b20e77ab1812fd38ac3f78b94c40217b
Contents?: true
Size: 861 Bytes
Versions: 20
Compression:
Stored size: 861 Bytes
Contents
module Gaku class AttendancesController < GakuController respond_to :js, :json, only: %i( create show ) def create exam_portion_score = ExamPortionScore.find(params[:exam_portion_score_id]) @attendance = exam_portion_score.attendances.build( student_id: exam_portion_score.student_id, attendance_type_id: params[:attendance][:attendance_type_id], reason: params[:attendance][:reason]) if @attendance.save respond_with(@attendance) do |format| format.json { render json: @attendance.to_json(root: false, include: :attendance_type) } end end end def show super do |format| format.json do render json: @attendance.as_json(root: false, include: :attendance_type) end end end end end
Version data entries
20 entries across 20 versions & 2 rubygems