app/controllers/polls_controller.rb
def broadcast_options
      poll = Poll.find(params[:id])
      if @poll.lecture == @lecture
        # broadcast update via ActionCable
        PollOptionsChannel.broadcast_to(poll, get_serialized_options)
      end
    end
# Send belonging poll_options to subscribers so they can update their data
Send belonging poll_options to subscribers so they can update their data
Send belonging poll_options to subscribers so they can update their data
def broadcast_options
      poll = Poll.find(params[:id])
      if @poll.lecture == @lecture
        PollOptionsChannel.broadcast_to(poll, get_serialized_options)
      end
    end
def broadcast_options poll = Poll . find ( params [ :id ] ) if @poll . lecture == @lecture PollOptionsChannel . broadcast_to ( poll , get_serialized_options ) end end
Send belonging poll_options to subscribers so they can update their data
Send belonging poll_options to subscribers so they can update their data
# broadcast update via ActionCable