<%= form_with(model: user) do |form| %> <% if user.errors.any? %> <div style="color: red"> <h2><%= pluralize(user.errors.count, "error") %> prohibited this user from being saved:</h2> <ul> <% user.errors.each do |error| %> <li><%= error.full_message %></li> <% end %> </ul> </div> <% end %> <div class="mb-3"> <%= form.label :name, class: 'form-label' %> <%= form.text_field :name, class: 'form-control' %> </div> <div class="mb-3"> <%= form.label :email, class: 'form-label' %> <%= form.text_field :email, class: 'form-control' %> </div> <div class="actions"> <%= form.submit class: 'btn btn-primary' %> </div> <% end %>