Skip to content

Using layout in controller #201

Description

@tomkadwill

I want to use a layout as a base for all of my views so my controller looks like:

defmodule ElixirWeberTest.Main do

  use Weber.Controller
  layout "application.html"

  def index([], _conn) do
    {:render, [], []}
  end

  def show([], _conn) do
    {:render, [foo: 'foo'], []}
  end
end

When I load the view for show get a page in the browser that looks like:

hi <%= 'Tom' %>
<%= @foo %>

If I remove use Weber.Controller and layout "application.html" then the view loads correctly displaying values in place of the tags.

Not sure if this is a bug or if I am doing something wrong. If this is confirmed as a bug then I am happy to work on a fix :)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions