Skip to content

Instantly share code, notes, and snippets.

@mrbongiolo
Last active July 18, 2020 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrbongiolo/98f1ba254e4b806f368c19a9f920df91 to your computer and use it in GitHub Desktop.
Save mrbongiolo/98f1ba254e4b806f368c19a9f920df91 to your computer and use it in GitHub Desktop.
Categories Index Example
.d-flex.align-items-center.justify-content-space-between
h3
| Listando categorias
= button_to 'Nova Categoria', new_category_path, method: :get, class: 'btn btn-primary'
table.table.table-hover
thead
tr
th
| Descrição
th
tbody
- @categories.each do |category|
tr
td
= category.desc
td
.d-flex.align-items-center.justify-content-center
= button_to 'Mostrar', category_path(category), method: :get, class: 'btn btn-success'
= button_to 'Editar', edit_category_path(category), method: :get, class: 'btn btn-warning'
= button_to 'Excluir', category_path(category), method: :delete, class: 'btn btn-danger btn-sm confirm', data: { confirm: 'Você tem certeza que deseja excluir essa categoria?'}
.d-flex.align-items-center.justify-content-space-between
h3
| Listando categorias
= button_to 'Nova Categoria', new_category_path, method: :get, class: 'btn btn-primary'
table.table.table-hover
thead
tr
th
| Descrição
th
tbody
- @categories.each do |category|
tr
td
= category.desc
td.text-align-right
= button_to 'Mostrar', category_path(category), method: :get, class: 'btn btn-success'
= button_to 'Editar', edit_category_path(category), method: :get, class: 'btn btn-warning'
= button_to 'Excluir', category_path(category), method: :delete, class: 'btn btn-danger btn-sm confirm', data: { confirm: 'Você tem certeza que deseja excluir essa categoria?'}
.d-flex {
display: flex;
}
.align-items-center: {
align-items: center;
}
.justify-content-end {
justify-content: end;
}
.justify-content-space-between {
justify-content: space-between;
}
.text-align-right {
text-align: right;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment