0
我需要從我的conn.assigns一些信息在我的頻道。例如:獲取渠道受讓人康涅狄格州鳳凰框架
def handle_in("save", params, socket) do
values = Poison.decode!(params)
current_user = conn.assigns.current_user
changeset =
current_user
|> build_assoc(:posts)
|> Post.changeset(values)
case Repo.insert(changeset) do
{:ok, _} ->
{:reply, :ok, socket}
{:error, reason} ->
{:reply, {:error, %{:msg => reason}}, socket}
end
end
但很明顯,conn將在這裏不可用。我應該怎樣去獲得的轉讓?