feat(user): display list and fix changeset
This commit is contained in:
parent
f1c1ca6d14
commit
fbb65e77c0
3 changed files with 16 additions and 11 deletions
|
@ -1,8 +1,11 @@
|
|||
defmodule LearningPhoenixWeb.UserController do
|
||||
use LearningPhoenixWeb, :controller
|
||||
alias LearningPhoenix.{Repo, User}
|
||||
|
||||
def index(conn, _params) do
|
||||
render(conn, :index)
|
||||
conn
|
||||
|> assign(:test, Repo.all(User))
|
||||
|> render(:index)
|
||||
end
|
||||
|
||||
def edit(conn, _params) do
|
||||
|
|
|
@ -6,4 +6,13 @@
|
|||
<p class="text-xl">
|
||||
Cette page contient la liste de tous les utilisateurs
|
||||
</p>
|
||||
<div class="flex flex-col gap-4 justify-center justify-items-center">
|
||||
<%= for user <- @test do %>
|
||||
<div class="flex flex-col gap-2">
|
||||
<p>Hello {user.name}!</p>
|
||||
<p>Your email is {user.email}</p>
|
||||
<p>And your hashed password is {user.password}.</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue