The problems is
I store the :player witin tables method, I also need accss it in the table method but the :player isn’t there.
Is there any way to implement this?
My code:
defmodule Test.PageController do
use Test, :controller
def index(conn, _params) do
render(conn, "index.html")
end
def tables(conn, %{"player" => name}) do
conn
|> assign(:player,name)
|>IO.inspect()
|> render("tables.html")
end
def table(conn, %{"table" => table}) do
IO.inspect(conn)
GenServer.call(String.to_existing_atom(table), {:join, conn.assigns[:player]})
render(conn, "table.html")
end
Thanks for help this!