title: when controller debuging, error "Endpoint.path/1 is undefined (module Endpoint is not available)" appeared
body: <p>When trying to manual rending, the following error message is received</p>
  <pre><code>    (phoenix_view 1.1.2) Phoenix.View.render(PenWeb.LoginView, &quot;show.html&quot;)
  iex(21)&gt; Phoenix.View.render(PenWeb.LoginView, &quot;show.html&quot;, message: &quot;Hello from IEx!&quot;) 
  %Phoenix.LiveView.Rendered{
    dynamic: #Function&lt;0.19280611/1 in PenWeb.LoginView.&quot;show.html&quot;/1&gt;,
    fingerprint: 131643824716591738070856747524267661638,
    root: false,
    static: [&quot;&lt;h2&gt;Log in&lt;/h2&gt;\n&quot;, &quot;&quot;]
  }
  iex(22)&gt; Phoenix.View.render_to_string(PenWeb.LoginView, &quot;show.html&quot;, message: &quot;Hello from IEx!&quot;)
  ** (UndefinedFunctionError) function Endpoint.path/1 is undefined (module Endpoint is not available)
      Endpoint.path(&quot;/login&quot;)
      lib/pen_web/templates/login/show.html.heex:2: anonymous fn/2 in PenWeb.LoginView.&quot;show.html&quot;/1
      (phoenix_live_view 0.17.11) lib/phoenix_live_view/engine.ex:124: Phoenix.HTML.Safe.Phoenix.LiveView.Rendered.to_iodata/1
      (phoenix_view 1.1.2) lib/phoenix/view.ex:482: Phoenix.View.render_to_string/3
  </code></pre>
  <p><code>show.html.heex</code> is as follows:</p>
  <pre><code>&lt;h2&gt;Log in&lt;/h2&gt;
  &lt;%= form_tag(Routes.login_path(Endpoint, :create)) do %&gt;
    &lt;div class=&quot;form-group&quot;&gt;
      &lt;label for=&quot;username&quot;&gt;Username or Email&lt;/label&gt;
      &lt;input id=&quot;username&quot; type=&quot;text&quot; class=&quot;form-control&quot; name=&quot;username&quot;&gt;
    &lt;/div&gt;
  
    &lt;div class=&quot;form-group&quot;&gt;
      &lt;label for=&quot;password&quot;&gt;Password&lt;/label&gt;
      &lt;!--span style=&quot;float: right;&quot;&gt;&lt;a href=&quot;&lt;%= Routes.password_reset_path(Endpoint, :show) %&gt;&quot;&gt;Forgot your password?&lt;/a&gt;&lt;/span--&gt;
      &lt;input id=&quot;password&quot; type=&quot;password&quot; class=&quot;form-control&quot; name=&quot;password&quot;&gt;
    &lt;/div&gt;
  
    &lt;!--input type=&quot;hidden&quot; name=&quot;return&quot; value=&quot;&lt;%= @return %&gt;&quot;--&gt;
  
    &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Log in&lt;/button&gt;
  
    &lt;br&gt;&lt;br&gt;
  
  &lt;% end %&gt;
  </code></pre>
  <p>login_view.ex is as follows:</p>
  <pre><code>defmodule PenWeb.LoginView do
    use PenWeb, :view
  end
  </code></pre>
  <p>routes is as follows:</p>
  <pre><code>macbook:pen yuchen$ mix phx.routes
            page_path  GET   /                                      PenWeb.PageController :index
           login_path  GET   /login                                 PenWeb.LoginController :show
           login_path  POST  /login                                 PenWeb.LoginController :create
           login_path  POST  /logout                                PenWeb.LoginController :delete
  live_dashboard_path  GET   /dashboard                             Phoenix.LiveDashboard.PageLive :home
  live_dashboard_path  GET   /dashboard/:page                       Phoenix.LiveDashboard.PageLive :page
  live_dashboard_path  GET   /dashboard/:node/:page                 Phoenix.LiveDashboard.PageLive :page
                       *     /dev/mailbox                           Plug.Swoosh.MailboxPreview []
  </code></pre>
  <p>PenWeb's <code>view</code> function is as follows:</p>
  <pre><code>  def view do
      quote do
        use Phoenix.View,
          root: &quot;lib/pen_web/templates&quot;,
          namespace: PenWeb
  
        # Import convenience functions from controllers
        import Phoenix.Controller,
          only: [get_flash: 1, get_flash: 2, view_module: 1, view_template: 1]
  
        # Include shared imports and aliases for views
        unquote(view_helpers())
      end
    end
  </code></pre>
  <p><code>view_helpers</code> function is as follows:</p>
  <pre><code>  defp view_helpers do
      quote do
        # Use all HTML functionality (forms, tags, etc)
        use Phoenix.HTML
  
        # Import LiveView and .heex helpers (live_render, live_patch, &lt;.form&gt;, etc)
        import Phoenix.LiveView.Helpers
  
        # Import basic rendering functionality (render, render_layout, etc)
        import Phoenix.View
  
        import PenWeb.ErrorHelpers
        import PenWeb.Gettext
        alias PenWeb.Router.Helpers, as: Routes
      end
  </code></pre>
  <p>end</p>