Skip to content

The link helper does not accept options #2041

@wout

Description

@wout

Unlike all other tag helpers, the link helper doesn't accept options. So you can't to do something like:

link "Something", to: Something::Index, options: aria_current(Something::Index)

private def aria_current(path)
  return {} of String => String unless current_page?(path)

  {"aria-current" => "page"}
end

because this is such a common use case, I've also been thinking about an additional helper to simplify this:

link_with_aria, to: Something::Index

But perhaps that a step too far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions