rootstrap/rails_hotwire_base

View on GitHub
app/views/users/passwords/new.html.erb

Summary

Maintainability
Test Coverage
<div class="max-w-md px-4">
  <div>
    <h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">
      Forgot your password?
    </h2>
    <p class="mt-2 text-center text-sm text-gray-600">
      <%- if devise_mapping.registerable? %>
        Or
        <%= link_to 'sign in', new_session_path(resource_name), class: %w[link] %>
      <% end %>
    </p>
  </div>

  <%= form_with(model: resource, url: password_path(resource_name), method: :post, data: { turbo: false }, class: %w[mt-8 space-y-6]) do |f| %>
    <%= render(FieldComponent.new(:email, form: f, type: :email, placeholder: 'Email', autofocus: true, autocomplete: 'email', required: true)) %>

    <%= render(ButtonComponent.new) do %>
      Send me reset password instructions
    <% end %>
  <% end %>
</div>