Using the name instead of using the name and the price is IMHO more consistent with the rest of the application, particularly for screen reader users. Writing texts clicking those links is also easier. I think the main reason why we used the price as part of the link was so the clickable area was bigger. We can accomplish the same result with CSS.
14 lines
243 B
Ruby
14 lines
243 B
Ruby
class Budgets::GroupsAndHeadingsComponent < ApplicationComponent
|
|
attr_reader :budget
|
|
|
|
def initialize(budget)
|
|
@budget = budget
|
|
end
|
|
|
|
private
|
|
|
|
def price(heading)
|
|
tag.span(budget.formatted_heading_price(heading))
|
|
end
|
|
end
|