lujanfernaud/prevy

View on GitHub
app/views/devise/passwords/edit.html.erb

Summary

Maintainability
Test Coverage
<div class="container">
  <div class="row justify-content-md-center">
    <div class="col-md-6 mt-2rem mb-2rem">

      <h2 class="text-center mt-2 mb-2rem">
        Change your password
      </h2>

      <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
        <%= devise_error_messages! %>
        <%= f.hidden_field :reset_password_token %>

        <div class="form-group mt-4">
          <%= f.label :password, "New password" %><br />
          <% if @minimum_password_length %>
            <em>(<%= @minimum_password_length %> characters minimum)</em><br />
          <% end %>
          <%= f.password_field :password, autofocus: true,
            autocomplete: "off",
            class: "form-control" %>
        </div>

        <div class="form-group">
          <%= f.label :password_confirmation, "Confirm new password" %><br />
          <%= f.password_field :password_confirmation,
            autocomplete: "off",
            class: "form-control" %>
        </div>

        <div class="form-group mb-4">
          <%= f.submit "Change my password",
            class: "btn btn-primary btn-block btn-lg btn-3d white-space-normal" %>
        </div>
      <% end %>

      <%= render "devise/shared/links" %>

    </div>
  </div>
</div>