Files
grecia/app/components/sdg_management/targets/index_component.rb
taitus 6d5333fc7a Add generic method for header
Unify Header to be able to use it from the admin as from the seg_management.
2020-12-16 13:16:48 +01:00

24 lines
418 B
Ruby

class SDGManagement::Targets::IndexComponent < ApplicationComponent
include Header
attr_reader :targets
def initialize(targets)
@targets = targets
end
private
def title
SDG::Target.model_name.human(count: 2).titleize
end
def attribute_name(attribute)
SDG::Target.human_attribute_name(attribute)
end
def header_id(object)
"#{dom_id(object)}_header"
end
end