Last active
October 21, 2016 20:38
-
-
Save bnhansn/36a6985393cf4b8ca4ca145cdcdf958c 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
| # top of file... | |
| plug Guardian.Plug.EnsureAuthenticated, [handler: Sling.SessionController] when action in [:rooms] | |
| # bottom of file... | |
| def rooms(conn, _params) do | |
| current_user = Guardian.Plug.current_resource(conn) | |
| rooms = Repo.all(assoc(current_user, :rooms)) | |
| render(conn, Sling.RoomView, "index.json", %{rooms: rooms}) | |
| end | |
| # ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment