Skip to content

Commit

Permalink
Use correct input type when collecting email addresses
Browse files Browse the repository at this point in the history
When filling out a form that collects an email address, I want my email to be validated in the browser so that I don’t find out it was incorrectly formatted when submitting the form.

Issues
------
- Closes #73
  • Loading branch information
stevepolitodesign committed Feb 5, 2022
1 parent f1ad3c7 commit 0d12755
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ end
<%= render partial: "shared/form_errors", locals: { object: form.object } %>
<div>
<%= form.label :email %>
<%= form.text_field :email, required: true %>
<%= form.email_field :email, required: true %>
</div>
<div>
<%= form.label :password %>
Expand Down Expand Up @@ -557,7 +557,7 @@ end
<%= form_with url: login_path, scope: :user do |form| %>
<div>
<%= form.label :email %>
<%= form.text_field :email, required: true %>
<%= form.email_field :email, required: true %>
</div>
<div>
<%= form.label :password %>
Expand Down Expand Up @@ -992,7 +992,7 @@ end
<%= render partial: "shared/form_errors", locals: { object: form.object } %>
<div>
<%= form.label :email, "Current Email" %>
<%= form.text_field :email, disabled: true %>
<%= form.email_field :email, disabled: true %>
</div>
<div>
<%= form.label :unconfirmed_email, "New Email" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= form_with url: login_path, scope: :user do |form| %>
<div>
<%= form.label :email %>
<%= form.text_field :email, required: true %>
<%= form.email_field :email, required: true %>
</div>
<div>
<%= form.label :password %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<%= render partial: "shared/form_errors", locals: { object: form.object } %>
<div>
<%= form.label :email, "Current Email" %>
<%= form.text_field :email, disabled: true %>
<%= form.email_field :email, disabled: true %>
</div>
<div>
<%= form.label :unconfirmed_email, "New Email" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<%= render partial: "shared/form_errors", locals: { object: form.object } %>
<div>
<%= form.label :email %>
<%= form.text_field :email, required: true %>
<%= form.email_field :email, required: true %>
</div>
<div>
<%= form.label :password %>
Expand Down

0 comments on commit 0d12755

Please sign in to comment.