programandoarg/pg_rails

View on GitHub
pg_layout/app/views/devise/sessions/new.html.erb

Summary

Maintainability
Test Coverage
<h2><%= t(".sign_in") %></h2>

<%= render FlashContainerComponent.new %>

<%= pg_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
  <div class="form-inputs">
    <%= f.input :email,
                required: false,
                autofocus: true,
                input_html: { autocomplete: "email" } %>
    <%= f.input :password,
                required: false,
                input_html: { autocomplete: "current-password" } %>
    <%#= f.input :remember_me, as: :hidden if devise_mapping.rememberable? %>
    <%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
  </div>

  <div class="form-actions">
    <%= f.button :submit, t(".sign_in") %>
  </div>
<% end %>

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

<% if dev_user_or_env? %>
  <div class="text-end" style="margin-top: 500px">
  <br>
  <br>
  <br>
  <ul style="max-width: 500px">
    <% User.order(:id).each do |user| %>
      <li><%= link_to user, admin_login_as_path(id: user.id) %></li>
    <% end %>
  </ul>
  </div>
<% end %>