View helper methods that makes it easy to add the html that is needed to display icons (from Font Awesome or Twitter Bootstrap) within links, or buttons.
Ruby
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
.travis.yml
Gemfile
LICENSE.txt
README.md
Rakefile
icon_link.gemspec

README.md

IconLink

Build Status Code Climate Gem Version

View helper methods that makes it easy to add the html that is needed to display icons (from Font Awesome or Twitter Bootstrap) within links, or buttons.

Installation

Add this line to your application's Gemfile:

gem 'icon_link'

And then execute:

$ bundle

Usage

Link with icon:

icon_link_to("Example", "http://www.example.com", icon: "icon-comment")
# => <a href="http://www.example.com" class="btn"><i class="icon-comment"></i> Example</a>

Button with icon:

icon_button_tag("Create example", icon: "icon-comment")
# => <button class="btn" type="submit"><i class="icon-comment"></i> Create example</button>

Text with icon:

iconize("Example", icon: "icon-comment")
# => <i class="icon-comment"></i> Example

Only icon:

icon_for("icon-comment")
# => <i class="icon-comment"></i>

See documentation: RubyDoc

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