Create model for users with email and password

This commit is contained in:
ricola 2025-04-06 17:04:31 -06:00
parent d6500e013d
commit 6682c8c300
6 changed files with 72 additions and 14 deletions

View file

@ -3,7 +3,14 @@
<p class="error"><%= @error %></p>
<% end %>
<form action="/login" method="POST">
<input name="email" placeholder="Email" />
<input name="password" type="password" placeholder="Password" />
<input type="submit" value="Log in" />
<p>
<label for="email">Email</label>
<input type="text" name="email">
</p>
<p>
<label for="password">Password</label>
<input type="password" name="password">
</p>
<button type="submit">Log in</button>
</form>
<a href="/signup">Create account</a>

13
views/signup.erb Normal file
View file

@ -0,0 +1,13 @@
<h1>Create account</h1>
<form action="/signup" method="post">
<p>
<label for="email">Email</label>
<input type="text" name="email">
</p>
<p>
<label for="password">Password</label>
<input type="password" name="password">
</p>
<button type="submit">Create account</button>
</form>

View file

@ -2,6 +2,8 @@
<p><%= @vote.description %></p>
<p>Hello, <%= current_user.email %>.</p>
<h2>Candidates</h2>
<ul>