Skip to content

Commit

Permalink
Document LiveView controller example requiring Phoenix controller (#1672
Browse files Browse the repository at this point in the history
)
  • Loading branch information
brettinternet committed Oct 14, 2021
1 parent 8b4b80b commit afdee17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/phoenix_live_view/controller.ex
Expand Up @@ -19,8 +19,11 @@ defmodule Phoenix.LiveView.Controller do
## Examples
defmodule ThermostatController do
...
import Phoenix.LiveView.Controller
use MyAppWeb, :controller
# "use MyAppWeb, :controller" should import Phoenix.LiveView.Controller.
# If it does not, you can either import it there or uncomment the line below:
# import Phoenix.LiveView.Controller
def show(conn, %{"id" => thermostat_id}) do
live_render(conn, ThermostatLive, session: %{
Expand Down
2 changes: 1 addition & 1 deletion lib/phoenix_live_view/router.ex
Expand Up @@ -301,7 +301,7 @@ defmodule Phoenix.LiveView.Router do
## Examples
defmodule AppWeb.Router do
defmodule MyAppWeb.Router do
use LiveGenWeb, :router
import Phoenix.LiveView.Router
Expand Down
2 changes: 1 addition & 1 deletion lib/phoenix_live_view/test/live_view_test.ex
Expand Up @@ -213,7 +213,7 @@ defmodule Phoenix.LiveViewTest do
## Examples
{:ok, view, html} =
live_isolated(conn, AppWeb.ClockLive, session: %{"tz" => "EST"})
live_isolated(conn, MyAppWeb.ClockLive, session: %{"tz" => "EST"})
Use `put_connect_params/2` to put connect params for a call to
`Phoenix.LiveView.get_connect_params/1` in `c:Phoenix.LiveView.mount/3`:
Expand Down

0 comments on commit afdee17

Please sign in to comment.