Sha256: 6af11a9a3ff175667e7e62ba7cd9f55c2ba4004b90553cfe36b9b5b7499669cb
Contents?: true
Size: 504 Bytes
Versions: 12
Compression:
Stored size: 504 Bytes
Contents
module Api class CoursesController < BaseController before_action :set_new_course!, only: :create before_action :authorize_janitor!, only: :create def create @course.save! render json: @course end private def course_params params.require(:course).permit(:slug, :code, :period, :description, shifts: [], days: []) end def set_new_course! @course = Course.new course_params end def protection_slug @course.slug end end end
Version data entries
12 entries across 12 versions & 1 rubygems