Project

fatcow

0.0
The project is in a healthy, maintained state
A gem to use the free Fatcow web icons in rails. All icons are provided under Creative Commons Attribution 3.0 as per the original license for the icons. Source is https://web.archive.org/web/20160323032439/http://www.fatcow.com/free-icons.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 1.8
~> 8
 Project Readme

Fatcow

This adds some basic helpers to rails that let you use the Fatcow icon set in all of it's early-2010s glory.

You can browse the icons via wikimedia.

Installation

To install, simply add it to your gemfile,

gem 'fatcow'

then add the (optional) stylesheet to your template:

<%= stylesheet_link_tag 'fatcow/application', "data-turbo-track": "reload" %>

and you're good to go!

How to use

In any view, just use the fci helper to place an arbitrary icon.

<%= fci :note %>

You can also include a status, which is a small icon placed in the bottom left hand corner of the icon.

<%= fci :note, :add %>

Use with models

You can also assign an icon to a model, which will then be displayable with a status reflecting the current state of the record. Add the has_icon macro into your model definition, and you're good to go.

class Alert < ActiveRecord
  has_icon :bell
end

There are some default statuses (:add for new records, :edit for persisted records in a form, etc.) but you can include + overwrite statues using the same macro. Provide show statuses to be used with record.show_icon and form statuses to be used with record.form_icon. Include the name of the status as the key, and the value should be a Proc that returns true/false, and is executed in the context of the record instance.

class Alert < ActiveRecord
  has_icon :bell, show: { attach: -> { has_attachment? } }, form: { warning: -> { invalid? } }
end

Then, to show your icon in a view, just call either #show_icon (when showing the resource) or #form_icon (when displaying a form) on a record instance, and pass it to fci. You cannot do this on collections, though that may be coming later.

<%= fci @alert.show_icon %>

All Icons

a big list of icons

Licensing

FatCow web icons are licensed under a Creative Commons Attribution 3.0 License. This library has opted to do the same because I'm not a lawyer and I have no idea what I'm doing.

All icons are attributed to FatCow, who formerly hosted the icons at http://www.fatcow.com/free-icons. (Archive)