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
|
2016-03-02 18:51:04 +01:00
|
|
|
#remove_dagschotel
|
|
|
|
= button_to "Current dagschotel", { controller: 'users', action: 'update', "user[dagschotel_id]" => "nil" }, method: :put, class: "btn btn-success"
|
|
|
|
|