ectomobile/app/views/users/index.haml

28 lines
992 B
Text
Raw Permalink Normal View History

2022-06-11 16:11:50 +00:00
%section.w-100.min-vh-100.d-flex.align-items-center.justify-content-center
%div
%nav
= link_to t('.back'), root_path, class: 'btn btn-info mb-3'
%table.table
%thead
-# Esto no es HTML5 estándar pero al parecer funciona
= form_for @user do |f|
%tr
%td{ colspan: 3 }
= f.label :email, class: 'visually-hidden'
= f.email_field :email, class: 'form-control', placeholder: t('.email'), required: true
%td= f.submit t('.create'), class: 'btn btn-success'
%tr
%th= t('.email')
%th= t('.created_by')
%th= t('.created')
%th= t('.actions')
%tbody
- @users.each do |user|
%tr
%th= user.email
%td= user.created_by.try :email
%td.text-center= user.created.count
%td= link_to t('.destroy'), user_path(user), method: :delete, class: 'btn btn-danger', data: { confirm: t('.confirm') }