tap/app/views/products/_links.html.haml

10 lines
569 B
Text
Raw Normal View History

2015-09-22 20:06:50 +02:00
- if controller_name == 'products' && can?(:manage, Product)
2015-09-17 14:05:33 +02:00
= 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
2015-09-22 20:06:50 +02:00
= button_to "Make dagschotel", { controller: 'users', action: 'update', "user[dagschotel_id]" => product.id }, method: :put, class: "btn btn-default"
2015-09-17 14:05:33 +02:00
- else
2015-09-22 20:06:50 +02:00
%span.btn.btn-success= "Current dagschotel"