Skip to content
Permalink
Browse files

display the todo list

  • Loading branch information...
dnsbty committed Apr 13, 2019
1 parent aa88ac5 commit 530818d665f84dce5e28fa58350d7af6088acc3e
@@ -1,11 +1,14 @@
defmodule LiveViewTodosWeb.TodoLive do
use Phoenix.LiveView

alias LiveViewTodos.Todos
alias LiveViewTodosWeb.TodoView

def mount(_session, socket) do
{:ok, socket}
{:ok, assign(socket, todos: Todos.list_todos())}
end

def render(assigns) do
~L"Rendering LiveView"
TodoView.render("todos.html", assigns)
end
end
@@ -0,0 +1,3 @@
<%= for todo <- @todos do %>
<div><%= todo.title %></div>
<% end %>
@@ -0,0 +1,3 @@
defmodule LiveViewTodosWeb.TodoView do
use LiveViewTodosWeb, :view
end

0 comments on commit 530818d

Please sign in to comment.
You can’t perform that action at this time.