Add ability to start lecture and redirect to recorded content.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
class LectureController < ApplicationController
|
||||
def start
|
||||
lecture = Lecture.find(params[:id])
|
||||
|
||||
Toggl::start_time_entry(
|
||||
description: lecture.title,
|
||||
project_id: lecture.course.toggl_project,
|
||||
)
|
||||
|
||||
if lecture.recording.present?
|
||||
redirect_to lecture.recording.recording_url, allow_other_host: true
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user