Files
nairobi/app/components/sdg_management/goals/index_component.rb
Javi Martín cb78a254f4 Extract method to provide a title for SDG pages
This way we'll avoid the duplication that can be found in the admin
section.
2020-12-02 12:38:03 +01:00

20 lines
351 B
Ruby

class SDGManagement::Goals::IndexComponent < ApplicationComponent
include SDGManagement::Header
attr_reader :goals
def initialize(goals)
@goals = goals
end
private
def title
SDG::Goal.model_name.human(count: 2).titleize
end
def attribute_name(attribute)
SDG::Goal.human_attribute_name(attribute)
end
end