mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-31 04:31:01 -05:00
Use button helper for crop wrangling
This commit is contained in:
@@ -16,6 +16,10 @@ module ButtonsHelper
|
||||
data: { confirm: 'All plantings associated with this garden will be marked as finished. Are you sure?' }
|
||||
end
|
||||
|
||||
def crop_edit_button(crop)
|
||||
edit_button(edit_crop_path(seed))
|
||||
end
|
||||
|
||||
def seed_edit_button(seed)
|
||||
edit_button(edit_seed_path(seed))
|
||||
end
|
||||
|
||||
@@ -5,12 +5,5 @@
|
||||
= succeed "." do
|
||||
%strong CROP WRANGLER
|
||||
|
||||
- if can? :edit, crop
|
||||
%p
|
||||
= link_to t(:edit_crop), edit_crop_path(crop), class: 'btn btn-default'
|
||||
- if can? :destroy, crop
|
||||
%p
|
||||
= link_to 'Delete crop', crop,
|
||||
method: :delete,
|
||||
data: { confirm: t('are_you_sure') },
|
||||
class: 'btn btn-default'
|
||||
%p= crop_edit_button(crop) if can? :edit, crop
|
||||
%p= delete_button(crop) if can? :destroy, crop
|
||||
|
||||
Reference in New Issue
Block a user