All Projects → evgenygarl → flag-icons-rails

evgenygarl / flag-icons-rails

Licence: MIT License
flag-icon-css sass gem for use in Ruby/Rails projects.

Programming Languages

ruby
36898 projects - #4 most used programming language
CSS
56736 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to flag-icons-rails

Flag Icon Css
🎏 A curated collection of all country flags in SVG — plus the CSS for easier integration
Stars: ✭ 7,982 (+24843.75%)
Mutual labels:  country-flags, icon-css
paper-countries
Select Dropdown with list of countries with flags and autocomplete
Stars: ✭ 16 (-50%)
Mutual labels:  country-flags
international-telephone-input
Integration to Magento 2 a jQuery plugin for entering and validating international telephone numbers.
Stars: ✭ 26 (-18.75%)
Mutual labels:  country-flags
PhoneCountryCodePicker
An iOS tableview picker for PhoneCountryCode (English & Chinese supported)
Stars: ✭ 31 (-3.12%)
Mutual labels:  country-flags
CountryPickerView
A simple country code picker on iOS, support chinese,english,spanish,national flag,ISO 3166-1 and calling code.(一个简洁的iOS国家代码选择器,支持中文、英语、西班牙语、国旗、ISO 3166-1、国际电话区号) your can search the ISO 3166 code,calling code or country name,the picker view will refresh automatically according to the content of your search.(你可以搜索ISO 3166码,电话区号或者国家名字,pikerView将会…
Stars: ✭ 26 (-18.75%)
Mutual labels:  country-flags
Simple form
Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup.
Stars: ✭ 7,877 (+24515.63%)
Mutual labels:  rails-helper

flag-icons-rails

Gem Version Gem Downloads Gem Total Downloads
Build Status Code Climate Codacy Badge

flag-icons-rails provides 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:

gem 'flag-icons-rails'

and then execute:

bundle install

Do not add gem to assets section if you want to use flag_icon rails helper.

Usage

In your application.css, include the file:

/*
 *= require flag-icon
 */

If you prefer SCSS, add this to your application.scss file:

@import "flag-icon";

Then restart your webserver if it was previously running.

Plain usage

In your view:

<span class="flag-icon flag-icon-by"></span>
<span class="flag-icon flag-icon-by flag-icon-squared"></span>

Rails Helper usage

In your view:

flag_icon(:by)
# => <span class="flag-icon flag-icon-by"></span>
flag_icon(:by, element: :div)
# => <div class="flag-icon flag-icon-by"></div>
flag_icon(:by, squared: true)
# => <span class="flag-icon flag-icon-by flag-icon-squared"></span>
flag_icon(:by, id: 'my-flag', class: 'strong')
# => <span id="my-flag" class="flag-icon flag-icon-by strong"></span>

Thanks

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].