Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.19 KB

README.md

File metadata and controls

49 lines (35 loc) · 1.19 KB

Faenza File Icons

Description

This gem provides a subset of the Faenza icons for use in your rails application as file type icons.

Installation

Add the following line to your Gemfile:

gem 'faenza-file-icons-rails'

Then run:

bundle install
rails g faenza

This will install all available icons in public/filetype-icons/ and create an initializer that you can use to access them.

Usage

You can add a helper method in application_helpers.rb similar to this to fetch the icon src path for a given file type:

def icon_for(type)
    "/" + (FAENZA_ICONS_FILES[type] || FAENZA_ICONS_FILES["unknown"])
end

You can then use this helper in your views as follows:

<img src="<% icon_for "png" %>" alt="icon"/>

License

Released under the GPL License.

Credits

Faenza icons. Visit the project page to obtain the icon source.