-
-
Save nicedawg/3bbe6f0f25443bcf8bc86dd03d30ef39 to your computer and use it in GitHub Desktop.
[Beginning Rails 6] Listing 8-5. User Form Partial in app/views/users/_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_with(model: user, local: true) do |form| %> | |
<% if user.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(user.errors.count, "error") %> prohibited this user from being saved:</h2> | |
<ul> | |
<% user.errors.full_messages.each do |message| %> | |
<li><%= message %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="field"> | |
<%= form.label :email %> | |
<%= form.text_field :email %> | |
</div> | |
<div class="field"> | |
<%= form.label :password %> | |
<%= form.password_field :password %> | |
</div> | |
<div class="field"> | |
<%= form.label :password_confirmation %> | |
<%= form.password_field :password_confirmation %> | |
</div> | |
<div class="actions"> | |
<%= form.submit %> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment