2024-02-16 15:13:09 -06:00
|
|
|
<%= form_with(model: user, local: true, html: { class: 'needs-validation', novalidate: true }) do |form| %>
|
|
|
|
<% if user.errors.any? %>
|
|
|
|
<div id="error_explanation" class="alert alert-danger" role="alert">
|
|
|
|
<h4><%= pluralize(user.errors.count, "error") %> prohibited this user from being saved:</h4>
|
|
|
|
<ul>
|
|
|
|
<% user.errors.full_messages.each do |message| %>
|
|
|
|
<li><%= message %></li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
2024-02-15 17:23:54 -06:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2024-02-16 15:13:09 -06:00
|
|
|
|
|
|
|
<div class="mb-3">
|
|
|
|
<%= form.label :email, class: 'form-label' %>
|
|
|
|
<%= form.email_field :email, id: :user_email, class: 'form-control' %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mb-3 form-check">
|
|
|
|
<%= form.check_box :admin, class: 'form-check-input', id: :user_admin %>
|
|
|
|
<%= form.label :admin, class: 'form-check-label' %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="actions">
|
|
|
|
<%= form.submit 'Save', class: 'btn btn-dark' %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|