Files
grecia/app/components/sdg_management/relations/index_component.rb
Javi Martín d18c627392 Add and apply Layout/EmptyLinesAfterModuleInclusion rule
This rule was added in rubocop 1.79. We were inconsistent about it, so
we're adding it to get more consistency.
2025-11-05 14:27:12 +01:00

33 lines
601 B
Ruby

class SDGManagement::Relations::IndexComponent < ApplicationComponent
include Header
attr_reader :records
def initialize(records)
@records = records
end
private
def title
t("sdg_management.menu.#{model_class.table_name}")
end
def model_class
records.model
end
def edit_path_for(record)
{
controller: "sdg_management/relations",
action: :edit,
relatable_type: record.class.name.tableize,
id: record
}
end
def search_label
t("admin.shared.search.label.#{model_class.table_name}")
end
end