Created
October 22, 2016 12:21
-
-
Save bnhansn/d445a32e46a22bd49873c32ffd97b813 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Sling.RoomChannel do | |
| use Sling.Web, :channel | |
| def join("rooms:" <> room_id, _params, socket) do | |
| room = Repo.get!(Sling.Room, room_id) | |
| response = %{ | |
| room: Phoenix.View.render_one(room, Sling.RoomView, "room.json"), | |
| } | |
| {:ok, response, assign(socket, :room, room)} | |
| end | |
| def terminate(_reason, socket) do | |
| {:ok, socket} | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment