Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johno/link_with_icon
A wrapper for the Rails link_to helper to add icons.
https://github.com/johno/link_with_icon
Last synced: 2 months ago
JSON representation
A wrapper for the Rails link_to helper to add icons.
- Host: GitHub
- URL: https://github.com/johno/link_with_icon
- Owner: johno
- License: mit
- Created: 2013-08-13T17:49:01.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-27T07:04:36.000Z (almost 10 years ago)
- Last Synced: 2024-10-19T17:29:37.969Z (3 months ago)
- Language: Ruby
- Homepage: http://johnotander.com/gems/2013/12/02/link-with-icon-gem/
- Size: 137 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# LinkWithIcon
Keep your `link_to` calls simple and readable, even when using icons.
```html+erb
<%= link_with_icon(:flag, 'Link Name', 'www.google.com') %>
# => Link Name
```## Installation
Add this line to your application's Gemfile:
gem 'link_with_icon'
And then execute:
$ bundle
Or install it yourself as:
$ gem install link_with_icon
## Usage
Using `link_with_icon` is as simple as pie:
```html+erb
<%= link_with_icon(:globe, 'A Link!', root_path) %>
# => A Link!
```It can handle all the normal options of the Rails `link_to` helper.
```html+erb
<%= link_with_icon(:arrow, 'Click Me', another_awesome_path, onclick: 'alert("things");') %>
# => Click Me
```## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request