mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-18 21:56:55 -04:00
Simplifying show_inactive_tickbox_path method
This commit is contained in:
@@ -67,16 +67,12 @@ module ApplicationHelper
|
||||
def show_inactive_tickbox_path(type, owner, show_all)
|
||||
all = show_all ? '' : 1
|
||||
if owner
|
||||
if type == 'plantings'
|
||||
plantings_by_owner_path(owner: owner.slug, all: all)
|
||||
elsif type == 'gardens'
|
||||
gardens_by_owner_path(owner: owner.slug, all: all)
|
||||
end
|
||||
elsif type == 'plantings'
|
||||
plantings_path(all: all)
|
||||
elsif type == 'gardens'
|
||||
gardens_path(all: all)
|
||||
return plantings_by_owner_path(owner: owner.slug, all: all) if type == 'plantings'
|
||||
return gardens_by_owner_path(owner: owner.slug, all: all) if type == 'gardens'
|
||||
end
|
||||
|
||||
return plantings_path(all: all) if type == 'plantings'
|
||||
return gardens_path(all: all) if type == 'gardens'
|
||||
end
|
||||
|
||||
def title(type, owner, crop, planting)
|
||||
|
||||
Reference in New Issue
Block a user