NavLinkTo

Simple

  • creator with css 'active' class if current page.

    Installation

    Add this line to your application's Gemfile:

    gem "nav_link_to", "~> 0.0.3"
    

    And then execute:

    $ bundle
    

    Or install it yourself as:

    $ gem install nav_link_to
    

    Usage

    nav_link_to 'Home', root_path
    nav_link_to 'Home', root_path, 'myClass'
    nav_link_to 'Home', root_path, nil, id:'myId'
    

    # Class is a necessary param if you want to use another attribute after, but you can set it 'nil'

    will return

    <li class="active"><a href="/admin">Home</a></li>
    <li class="active myClass"><a href="/">Home</a></li>
    <li class="active" id="myId"><a href="/admin">Home</a></li>
    

    Contributing

    1. Fork it
    2. Create your feature branch (git checkout -b my-new-feature)
    3. Commit your changes (git commit -am 'Added some feature')
    4. Push to the branch (git push origin my-new-feature)
    5. Create new Pull Request