LiveView Basics

A LiveView without Render

As noted in the documentation, render/1 isn't necessary if you have a template in the same directory using the same name structure.


Documentation:

https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#c:render/1

scope "/", LiveViewBasicsWeb do
  pipe_through :browser

  live "/without-render", WithoutRenderLive
end
defmodule LiveViewBasicsWeb.WithoutRenderLive do
  use LiveViewBasicsWeb, :live_view
end
<Layouts.app flash={@flash}>
  <div class="hero">
    <div class="hero-content text-center">
      <div>
        <h1 class="text-4xl font-bold">LiveView Basics</h1>
        <h2 class="text-xl">A LiveView without Render</h2>
        <p class="py-6">
          As noted in the documentation, <code class="bg-base-content text-base-100 px-1">render/1</code>
          isn't necessary if you have a template in the same directory using the same name structure.
        </p>
      </div>
    </div>
  </div>
</Layouts.app>