Skip to content

Releases: bxt/nav_links

v1.1.0 Featuring Simplified Grouping

09 Oct 17:44
@bxt bxt
Compare
Choose a tag to compare

The syntax for grouping navigational links was simplified to reduce duplication, from:

<ul class="nav">
  <% nav_links url_segment: 1, wrapper: 'li', selected_class:'active' do |nav| %>
    <%= nav.nav_link_to "Projects", projects_path %>
    <%= nav.nav_link_to "People", people_path %>
    <%= nav.nav_link_to "About", about_path %>
  <% end %>
</ul>

To:

<ul class="nav">
  <% nav_links url_segment: 1, wrapper: 'li', selected_class:'active' do |nav| %>
    <%= nav.link_to "Projects", projects_path %>
    <%= nav.link_to "People", people_path %>
    <%= nav.link_to "About", about_path %>
  <% end %>
</ul>

Basically the nav_link_to method is now named only link_to inside of blocks. Note that you can still access rails' link_to method if you leave out the nav. part. The old method name is still supported until the 2.x release, so you can update now and take your time migrating.

v1.0.0 Intital Release

30 Sep 13:58
@bxt bxt
Compare
Choose a tag to compare

All the things from nav_lynx should still work and be tested, and the block grouping was added.