IconLink
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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request