Project

nav_node

0.0
No commit activity in last 3 years
No release in over 3 years
Navigate for rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
~> 10.0

Runtime

 Project Readme

NavNode

Nav for rails

Installation

Add this line to your application's Gemfile:

gem 'nav_node'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nav_node

Usage

with erb

  <%= render_nav class: 'menu' do |node| %>
    <%= node.+ "Node1", "/node1", class: "menu-node1", match: ['/node1', '/node2'] %>
    <%= node.+ "Node2", "/node2", class: "menu-node2", match: '/node2/*' %>
  <% end %>

with Slim


  = render_nav class: 'menu' do |node|
    - node.+ "Node1", "/node1", class: 'menu-node1', match: ['/node1', '/node2']
    - node.+ "Node2", "/node2", class: 'menu-node2', match: '/node2/*'

in "node1" page output

  <ul class="inline-menu">
    <li class="first">
      <a href="/node1"><span>Node1</span></a>
      </li>
      <li class="last active">
        <a href="/node2"><span>Node2</span></a>
      </li>
   </ul>

in "node2" page output

  <ul class="inline-menu">
    <li class="first active">
      <a href="/node1"><span>Node1</span></a>
      </li>
      <li class="last active">
        <a href="/node2"><span>Node2</span></a>
      </li>
   </ul>

License

Copyright © 2015, Ye Li. Released under the MIT License