This way it will be easier to change the behavior of all table actions, like adding ARIA attributes. In the past, when we changed the behavior of the `link_to` method, we had to change all table action classes.
19 lines
358 B
Ruby
19 lines
358 B
Ruby
class Admin::BudgetGroups::GroupsComponent < ApplicationComponent
|
|
include Admin::Namespace
|
|
attr_reader :groups
|
|
|
|
def initialize(groups)
|
|
@groups = groups
|
|
end
|
|
|
|
private
|
|
|
|
def budget
|
|
@budget ||= groups.first.budget
|
|
end
|
|
|
|
def headings_path(group)
|
|
send("#{namespace}_budget_group_headings_path", group.budget, group)
|
|
end
|
|
end
|