From 6deb9f966eb9a280cc16428ba9324ffc15ea60a8 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 18 Aug 2016 15:49:51 +0200 Subject: Live timelines using ActionCable --- app/channels/timeline_channel.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/channels/timeline_channel.rb (limited to 'app/channels/timeline_channel.rb') diff --git a/app/channels/timeline_channel.rb b/app/channels/timeline_channel.rb new file mode 100644 index 000000000..c128fae58 --- /dev/null +++ b/app/channels/timeline_channel.rb @@ -0,0 +1,10 @@ +# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading. +class TimelineChannel < ApplicationCable::Channel + def subscribed + stream_from "timeline:#{current_user.id}" + end + + def unsubscribed + # Any cleanup needed when channel is unsubscribed + end +end -- cgit