31 lines
1.2 KiB
Plaintext
31 lines
1.2 KiB
Plaintext
- model_class = Product
|
|
div.page-header= title :index, model_class
|
|
- if @products.any?
|
|
table.table.table-striped
|
|
thead
|
|
tr
|
|
th= model_class.human_attribute_name(:name)
|
|
th= model_class.human_attribute_name(:code)
|
|
th= model_class.human_attribute_name(:price)
|
|
th= ProductCategory.model_name.human
|
|
th= Supplier.model_name.human
|
|
th= model_class.human_attribute_name(:created_at)
|
|
th=t 'helpers.actions'
|
|
tbody
|
|
- @products.each do |product|
|
|
tr
|
|
td= link_to product.name, product
|
|
td= product.code
|
|
td= product.price
|
|
td= link_to product.product_category.name, product.product_category
|
|
td= link_to product.supplier.name, product.supplier
|
|
td=l product.created_at, format: :short
|
|
td
|
|
= link_to t('helpers.links.edit'), [:edit, product], class: 'btn btn-mini'
|
|
'
|
|
= link_to t("helpers.links.destroy"), product, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
|
|
- else
|
|
= no_content_given model_class
|
|
= link_to t("helpers.links.new"), new_product_path, class: 'btn btn-primary'
|
|
|