<h1>Reset password</h1>

<div class="row">
  <div class="col-md-6 col-md-offset-3">
    <%= form_with(model: @user, url: password_reset_path(params[:id]), local: true) do |f| %>
      <% if @user.errors.any? %>
        <div class="error_explanation">
          <div class="alert alert-danger">
            The form contains <%= pluralize(@user.errors.count, "error") %>.
          </div>
          <ul>
            <% @user.errors.full_messages.each do |msg| %>
              <li><%= msg %></li>
            <% end %>
          </ul>
        </div>
      <% end %>

      <%= hidden_field_tag :email, @user.email %>

      <div class="form-group">
        <%= f.label :password %>
        <%= f.password_field :password, class: 'form-control' %>
      </div>

      <div class="form-group">
        <%= f.label :password_confirmation, "Confirmation" %>
        <%= f.password_field :password_confirmation, class: 'form-control' %>
      </div>

      <%= f.submit "Update password", class: "btn btn-primary" %>
    <% end %>
  </div>
</div> 