Added missing harvest actions

This commit is contained in:
Brenda Wallace
2019-01-22 17:11:30 +13:00
parent c811ab1f51
commit 8ae062fe9b
2 changed files with 12 additions and 6 deletions

View File

@@ -1,4 +1,12 @@
module ButtonsHelper
def harvest_add_photo_button(harvest)
button(new_photo_path(id: harvest.id, type: "harvest"), 'buttons.add_a_photo', 'camera')
end
def harvest_edit_button(harvest)
button(edit_harvest_path(harvest), 'buttons.edit', 'pencil')
end
def garden_plant_something_button(garden)
button(new_planting_path(garden_id: garden.id), 'buttons.plant_something_here', 'leaf')
end

View File

@@ -1,7 +1,5 @@
.harvest-actions
- if can?(:edit, harvest) || can?(:destroy, harvest)
.btn-group
- if can? :edit, harvest
= render 'shared/buttons/edit', path: edit_harvest_path(harvest)
- if can? :destroy, harvest
.pull-right= render 'shared/buttons/delete', path: harvest_path(harvest)
.btn-group
= harvest_edit_button(harvest) if can? :edit, harvest
= harvest_add_photo_button(harvest)
= delete_button(harvest) if can? :destroy, harvest