Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
The links renderer just renders a set of links, wrapped in a
<div class="my_dom_id"> <a id="books" href="/books">Books</a> <a id="music" href="/musics" class="selected">Music</a> <a id="dvds" href="/dvds">Dvds</a> </div>
The Links renderer works best for very simple, one level navigations where you don't need the extra HTML list tags (e.g. for a simple footer navigation).
To use this renderer call
render_navigation renderer: :links
You can pass the following options to
render_navigation when using the links renderer:
:renderer- set to :links to use the links renderer
:join_with– to specify the character or string which should be used to join your links. The preferred way to visually separate your links is using CSS. Only use
:join_withif you want a special character for separation. If you change this option, do not forget to also specify the whitespace around your join character, e.g.
join_with: ' | '. It’s safer to use escaped HTML characters when using special characters. You could even consider to escape the whitespace (
Attention: Please be aware that the Links renderer does NOT render nested navigation. It only renders one level at a time. I.e. to render all the levels, you have to render them separately:
.primary= render_navigation renderer: :links, level: 1 .secondary= render_navigation renderer: :links, level: 2