Skip to content

Instantly share code, notes, and snippets.

@thestrabusiness
thestrabusiness / backend_usage.rb
Created March 4, 2023 15:04
React + ActionCable Example
class GameChannel < ApplicationCable::Channel
def subscribed
game = Game.find(params[:id])
stream_for game
end
end
## When the game state changes
GameChannel.broadcast_to(game, GameSerializer.render(game))
@thestrabusiness
thestrabusiness / .block
Created June 1, 2018 12:45
fresh block
license: mit
@thestrabusiness
thestrabusiness / .block
Last active May 31, 2018 14:30
fresh block
license: mit
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'VisitDays'
});