Phone number with country code using rails gem

Total Blog Views: 60

Blog Status: publish

Created By: asad_fazlani Created at: 09-07-2021

Tags: shadbox rails ruby on rails gem rails gem rails-intl-tel-input rails-intl-tel-input gem gem "rails-intl-tel-input"

Phone number with country code and flag using rails gem.

Demo

form demo click here

Installation :

Gem

Add gem in gem file

 

gem "rails-intl-tel-input"

After adding gem  run below command

bundle

Javascript

jquery add the following to /app/assets/javascripts/application.js:

//= require intlTelInput

Css

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

*= require intlTelInput

View

Add below code for view as per required

<%= intl_tel_input_tag(:tel) %>
or form builder
<%= form.intl_tel_input_tag(:tel) %>
output
 


asad_fazlani

Technical Blogger at shadbox



Comments



  • swazahmad | almost 4 years ago
    Good blog🙏🙏🙏
Buy traffic for your website

About Shadbox

we have the “Get things executed” lifestyle at our place of work. There are not any excuses, no if’s or however’s in our dictionary. committed to navigating the ship of creativity to create cell answers, we resolve the real-lifestyles troubles of our clients and their clients. Our passion for work has won us many awards, year after 12 months.

Services

Downloads