mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-26 18:56:06 -04:00
Plant something button
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
module ButtonsHelper
|
||||
include IconsHelper
|
||||
def garden_plant_something_button(garden)
|
||||
return unless can? :edit, garden
|
||||
link_to new_planting_path(garden_id: garden.id), class: "btn btn-default" do
|
||||
planting_icon + ' ' + t('buttons.plant_something_here')
|
||||
end
|
||||
end
|
||||
|
||||
def plant_something_button
|
||||
return unless can? :create, Planting
|
||||
link_to new_planting_path, class: "btn btn-default" do
|
||||
planting_icon + ' ' + t('buttons.plant_something')
|
||||
end
|
||||
end
|
||||
|
||||
def garden_mark_active_button(garden)
|
||||
link_to t('buttons.mark_as_active'),
|
||||
garden_path(garden, garden: { active: 1 }),
|
||||
|
||||
Reference in New Issue
Block a user