tap/app/views/products/_links.html.haml
2015-09-17 14:05:33 +02:00

9 lines
605 B
Text

- if controller_name == 'products' && current_user && current_user.admin?
= link_to "Edit", edit_product_path(product), class: "btn btn-default"
= link_to "Delete", product_path(product), method: :delete, class: "btn btn-danger", data: {confirm: 'Are you sure?'}
- if controller_name == 'users'
.product_dagschotel
- if current_user.dagschotel != product
= link_to "Make dagschotel", dagschotel_user_path(current_user, product), class: "btn btn-default"
- else
= link_to "Huidige dagschotel", dagschotel_user_path(current_user, product), class: "btn btn-success", disabled: true