Skip to content

Instantly share code, notes, and snippets.

@8zca
Last active January 19, 2020 14:58
Show Gist options
  • Save 8zca/f025b052aba23350fce580565133240a to your computer and use it in GitHub Desktop.
Save 8zca/f025b052aba23350fce580565133240a to your computer and use it in GitHub Desktop.
lib/phoenix_admin_web/views/session_view.ex
# lib/phoenix_admin_web/views/session_view.ex
defmodule PhoenixAdminWeb.SessionView do
use PhoenixAdminWeb, :view
end
# lib/phoenix_admin_web/template/new.html.eex
<%= form_for @changeset, Routes.session_path(@conn, :login), fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<%= label f, :email %>
<%= text_input f, :email %>
<%= error_tag f, :email %>
<%= label f, :password %>
<%= password_input f, :password %>
<%= error_tag f, :password %>
<div>
<%= submit "Login" %>
</div>
<% end %>
<div>
<%= link "Sign up", to: Routes.user_path(@conn, :new) %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment