We forgot to do so in commit d827768c0. In order to avoid the same
mistake in the future, we're extracting a method to get these
attributes. We're also adding tests, since we didn't have any tests to
check that the `dir` attribute was properly set.
17 lines
456 B
Ruby
17 lines
456 B
Ruby
module LayoutsHelper
|
|
def layout_menu_link_to(text, path, is_active, options)
|
|
title = t("shared.go_to_page") + text
|
|
|
|
if is_active
|
|
tag.span(t("shared.you_are_in"), class: "show-for-sr") + " " +
|
|
link_to(text, path, options.merge(class: "is-active", title: title))
|
|
else
|
|
link_to(text, path, options.merge(title: title))
|
|
end
|
|
end
|
|
|
|
def common_html_attributes
|
|
render Layout::CommonHTMLAttributesComponent.new
|
|
end
|
|
end
|