Files
nairobi/app/helpers/link_list_helper.rb
Javi Martín d1ab8ac29b Split li tags in link list helper
This way we generate the same HTML as we generate everywhere where we
manually generate lists of links. Having a blank space betwwen tags
results in a space being introduced when the elements are displayed
inline (or with `inline-block`).

So in places where we don't want that space between the elements we have
to use a flex layout.
2021-01-27 15:56:58 +01:00

14 lines
347 B
Ruby

module LinkListHelper
def link_list(*links, **options)
return "" if links.compact.empty?
tag.ul(options) do
safe_join(links.compact.map do |text, url, current = false, **link_options|
tag.li(({ "aria-current": true } if current)) do
link_to text, url, link_options
end
end, "\n")
end
end
end