Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify layout as option in configuration #99

Open
nkezhaya opened this issue Jul 6, 2016 · 4 comments
Open

Specify layout as option in configuration #99

nkezhaya opened this issue Jul 6, 2016 · 4 comments

Comments

@nkezhaya
Copy link

nkezhaya commented Jul 6, 2016

(As opposed to being forced to use addict/addict.html)

@joshuaswilcox
Copy link

can you not change

plug :put_layout, {Addict.AddictView, "addict.html"}

to be a different file?

@glaszig
Copy link

glaszig commented Jul 29, 2016

@joshuaswilcox i was under that impression, too, but it somehow has no effect.

i tried

plug :put_layout, {MyApp.LayoutView, "app.html"}

@joshuaswilcox
Copy link

Hmm, yeah i thought i had that working, but I guess not

@joshuaswilcox
Copy link

I seems that doing that in the controller does nothing because in addict/lib/addict/controller.ex

  defp put_addict_layout(conn) do
    conn
    |> put_layout({Addict.AddictView, "addict.html"})
  end

is defined and piped into each route

  def login(%{method: "GET"} = conn, _) do
    csrf_token = generate_csrf_token
    conn
    |> put_addict_layout
    |> render("login.html", csrf_token: csrf_token)
  end

so I guess you need to override the controller to change it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants