Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derrickreimer/linkety
A collection of handy link helpers for Rails views
https://github.com/derrickreimer/linkety
Last synced: 5 days ago
JSON representation
A collection of handy link helpers for Rails views
- Host: GitHub
- URL: https://github.com/derrickreimer/linkety
- Owner: derrickreimer
- License: mit
- Created: 2012-07-22T18:21:26.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-01-02T03:22:12.000Z (almost 9 years ago)
- Last Synced: 2024-11-29T12:53:46.649Z (23 days ago)
- Language: Ruby
- Size: 14.6 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Linkety
Linkety is a collection of handy link helpers for Rails views. Helpers include
`current_link_to`, `active_link_to_if`, and `inactive_link_to_if`.## Installation
Add this line to your application's Gemfile:
gem 'linkety'
And then execute:
$ bundle
Or install it yourself as:
$ gem install linkety
## Usage
Sometimes you want to add a specific class to a link if you are currently on the
page the link points to. Navigation menus are a classic example of this scenario.
Simply use the `current_link_to` like so:```html
```
When you are on the home page, this helper with output a link with a `current`
class. You can change the default class name by defining a `:current_class` option.
If you want match the current URL against a custom regex instead of an exact path match,
simply pass in a regex object for the `:pattern` option.
## 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