0.0
No commit activity in last 3 years
No release in over 3 years
This gem replaces standard checkboxes and radio buttons with Font Awesome characters making them look the same across all browsers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

fa-checkbox

A simple Ruby On Rails gem to replace standard browser's checkboxes and radio buttons with Font Awesome icons.

Dependencies

This gem has a dependency to the font-awesome-rails gem and makes Font Awesome and font-awesome-rails available in your application implicitly.

Installation

Add this to your Gemfile:

gem 'fa-checkbox'

and run bundle install.

Usage

In your application.css, include the css file:

/*
*= require fa-checkbox
*/

to make it picked up by the asset pipline. Restart your webserver if it was running.

Disable in fa-checkbox for older browsers if needed

If you support some old browsers that make trouble with custom @font-face fonts, you can disable fa-checkbox by conditional inclusion of fa-checkbox-revert.css. You need to make it available to your application by pre-compiling it first. Add this line to confic/initializers/assets.rb or another your environment initialization file:

Rails.application.config.assets.precompile += %w(fa-checkbox-revert.css)

And included it to your application layout depending on your conditions. For example, for IE8 and below:

<!--[if lt IE 9]>
<%= stylesheet_link_tag 'fa-checkbox-revert', media: :all %>
<!--<![endif]-->

Caution

Make sure that all labels in your application are linked to their checkboxes and radio buttons with <label for='...'> attribute properly. Otherwise they will not react to you clicks.