Files
codeocean/app/helpers/action_cable_helper.rb
Sebastian Serth d63700c7db Add live dashboard for teachers in the context of an exercise
This commit also adds the fundamentals for ActionCable
2019-03-06 14:00:59 +01:00

16 lines
559 B
Ruby

module ActionCableHelper
def trigger_rfc_action_cable
if submission.study_group_id.present?
ActionCable.server.broadcast(
"la_exercises_#{exercise_id}_channel_study_group_#{submission.study_group_id}",
id: id,
html: (ApplicationController.render(partial: 'request_for_comments/list_entry',
locals: {request_for_comment: self})))
end
end
def trigger_rfc_action_cable_from_comment
RequestForComment.find_by(submission: file.context).trigger_rfc_action_cable
end
end