mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-06-04 06:12:41 -04:00
22 lines
428 B
Ruby
22 lines
428 B
Ruby
# frozen_string_literal: true
|
|
|
|
module SeedsHelper
|
|
def display_seed_quantity(seed)
|
|
if seed.quantity.nil?
|
|
'seeds'
|
|
else
|
|
pluralize(seed.quantity, 'seed')
|
|
end
|
|
end
|
|
|
|
def display_seed_description(seed)
|
|
if seed.description.present?
|
|
return truncate(seed.description, length: 130, separator: ' ', omission: '... ') do
|
|
link_to "Read more", seed_path(seed)
|
|
end
|
|
end
|
|
|
|
''
|
|
end
|
|
end
|