From 96432e8b6bb4c57e47717c579175e6681cad84ca Mon Sep 17 00:00:00 2001 From: nelsonic Date: Thu, 6 Jun 2019 12:01:20 +0100 Subject: [PATCH] add templates/page/counter.html.leex for rendering counter in Live View #1 --- lib/live_view_counter_web/live/counter_live.ex | 8 +------- .../templates/page/counter.html.leex | 5 +++++ 2 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 lib/live_view_counter_web/templates/page/counter.html.leex diff --git a/lib/live_view_counter_web/live/counter_live.ex b/lib/live_view_counter_web/live/counter_live.ex index cddf76de..c5c46da6 100644 --- a/lib/live_view_counter_web/live/counter_live.ex +++ b/lib/live_view_counter_web/live/counter_live.ex @@ -4,13 +4,7 @@ defmodule LiveViewCounterWeb.CounterLive do @topic "live" def render(assigns) do - ~L""" -
-

The count is: <%= @val %>

- - -
- """ + LiveViewCounterWeb.PageView.render("counter.html", assigns) end def mount(_session, socket) do diff --git a/lib/live_view_counter_web/templates/page/counter.html.leex b/lib/live_view_counter_web/templates/page/counter.html.leex new file mode 100644 index 00000000..5d6405c0 --- /dev/null +++ b/lib/live_view_counter_web/templates/page/counter.html.leex @@ -0,0 +1,5 @@ +
+

The count is: <%= @val %>

+ + +