This gem provides a subset of the Faenza icons for use in your rails application as file type icons.
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.
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"/>
Released under the GPL License.
Faenza icons. Visit the project page to obtain the icon source.