No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
Gemfile
LICENSE
README.md
Rakefile
nav_link_to.gemspec

README.md

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.4"
    

    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, 'myLiClass', { id: 'li_element_id' }, { id: 'a_element_id' }
    nav_link_to 'Home', root_path, nil, { id: 'li_element_id' }, { id: 'a_element_id' }
    

    You can set class to nil, but it is a necessary param

    will return

    <li class="active"><a href="/admin">Home</a></li>
    <li class="active myLiClass" id="li_element_id"><a href="/" id="a_element_id">Home</a></li>
    <li class="active" id="li_element_id"><a href="/" id="a_element_id">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