No release in over 3 years
Low commit activity in last 3 years
Integrate with intl-tel-input to provide international telephone numbers input and form helper.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0
>= 0

Runtime

 Project Readme

rails-intl-tel-input

Build Status Coverage Status

Integrate with intl-tel-input to provide international telephone numbers input and form helper.

Installation

Add this line to your application's Gemfile:

gem 'rails-intl-tel-input'

And then execute:

bundle

Or install it yourself as:

gem install rails-intl-tel-input

Usage

Require Javascript

Make sure you required jQuery and add the following to /app/assets/javascripts/application.js:

//= require intlTelInput

Require CSS

Add the following to /app/assets/stylesheets/application.css:

/*
 *= require intlTelInput
 */

Helpers

You can use intl_tel_input_tag and intl_tel_input.

<%= intl_tel_input_tag(name, value, intl_tel_input_options, html_options) %>
<%= intl_tel_input_tag(:tel, 'red', {:allowDropdown => false}, {:class => 'tel'}) %>
<%= intl_tel_input_tag(:tel) %>

or form builder

<% form_for @item do |f| %>
<%= f.intl_tel_input(method, intl_tel_input_options, html_options) %>
<%= f.intl_tel_input(:tel, {:allowDropdown => false}, {:class => 'tel'}) %>
<%= f.intl_tel_input(:tel) %>
<% end %>

License

The gem is available as open source under the terms of the MIT License.

Contact

The project's website is located at https://github.com/emn178/rails-intl-tel-input
Author: Chen, Yi-Cyuan (emn178@gmail.com)