flag-icons-rails [](https://rubygems.org/gems/flag-icons-rails) [](https://rubygems.org/gems/flag-icons-rails) [](https://codeclimate.com/github/eugenegarl/flag-icons-rails)
---
**flag-icons-rails** provides [flag-icon-css](https://github.com/lipis/flag-icon-css) - a collection of all country flags in SVG - as a Ruby gem for use with the asset pipeline.
### Installation
Add this to your Gemfile:
```ruby
gem 'flag-icons-rails'
```
and then execute:
```sh
bundle install
```
Do not add gem to `assets` section if you want to use [ `flag_icon` rails helper](#rails-helper-usage).
### Usage
In your `application.css`, include the file:
```css
/*
*= require flag-icon
*/
```
If you prefer [SCSS](http://sass-lang.com/documentation/file.SASS_REFERENCE.html), add this to your
`application.scss` file:
```scss
@import "flag-icon";
```
Then restart your webserver if it was previously running.
### Plain usage
In your view:
```html
```
```html
```
### Rails Helper usage
In your view:
```ruby
flag_icon(:by)
# =>
```
```ruby
flag_icon(:by, true)
# =>
```
```ruby
flag_icon(:by, id: 'my-flag', class: 'strong')
# =>
```
### Thanks
* **lipis** for amazing collection of all country flags [flags-icon-css](https://github.com/lipis/flag-icon-css)
* **cfiorini** for [flag-icon-sass](https://github.com/cfiorini/flag-icon-sass) gem this one is based on