Skip to content

voran/faenza-file-icons-rails

Repository files navigation

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.

About

Rails file icons based on the Faenza theme

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published