Created
October 22, 2016 14:35
-
-
Save bnhansn/90158b18cc64d67d87be13accd21194e 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.MessageView do | |
| use Sling.Web, :view | |
| def render("message.json", %{message: message}) do | |
| %{ | |
| id: message.id, | |
| inserted_at: message.inserted_at, | |
| text: message.text, | |
| user: %{ | |
| email: message.user.email, | |
| username: message.user.username | |
| } | |
| } | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment