ispyropoulos / intl-tel-input-rails Goto Github PK
View Code? Open in Web Editor NEWintl-tel-input for the Rails asset pipeline
License: MIT License
intl-tel-input for the Rails asset pipeline
License: MIT License
Hi Ilias,
I've yanked the gem on Rubygem.org. As I mentioned, may I open up a pull request to update to plugin to the newest version? There have been major changes in the plugin since the the last release of the gem.
Again, I apologize for my ignorance of the convention of the community.
Jason
i have try to use in one form with 2 inputs using the plugin
<script type="text/javascript" charset="utf-8">
$( document ).ready(function() {
$('#company_telephone').intlTelInput({
formatOnInit: true,
separateDialCode: true,
utilsScript: "assets/libphonenumber/utils.js"
});
$('#contact_telephone').intlTelInput({
formatOnInit: true,
separateDialCode: true,
utilsScript: "assets/libphonenumber/utils.js"
});
});
</script>
<input id="company_telephone" required="required" maxlength="15" minlenght="10" size="15" type="text" value="+529999999999" name="company[telephone]" class="form-control" autocomplete="off" placeholder="1 222 123 4567">
<input id="contact_telephone" required="required" maxlength="15" minlenght="10" size="15" type="text" value="+529999999999" name="contact[telephone]" class="form-control" autocomplete="off" placeholder="1 222 123 4567">
But at time i make a change in the contact_telephone it add +52 to company_telephone :(
Hey,
I just installed the gem, but I don't see how to get running the flags in the README, what I did:
gem 'intl-tel-input-rails'
bundle
//= require intlTelInput
@import "intlTelInput";
Nothing happens, how do I get this running? I can't see the flags or even the dropdown showing on my input field, why?
Note: I also did initialize the field with jQuery $("#phone").intlTelInput();
and nothing as well.
I'd really appreciate your help! ๐
Thank you!
We have updated our gem to 11.0.4 from 9.0.0 and now the flag icon isn't showing unless I add the line
.iti-flag {background-image: image-url("flags.png");}
This is an awesome gem! I was wondering if there was a way to specify the dependencies so that you could choose to use sass-rails
or sassc-rails
as your SASS engine, since this is the only part of my project that requires sass-rails
.
Thanks!
Version 14.0 of intl-tel-input got released September 2018 and removes the jQuery dependency.
I think it would be useful to update the Gem.
Hey,
thanks for the gem.
for me it start working after I add '/' before asset in JS snippet.
utilsScript: "/assets/libphonenumber/utils.js"
is this a typo or it depends on configuration?
Tested on a Rails 4.2 app.
The intlTelInput.css file references the flags.png sprite which is not fingerprinted. When deploying on production using the asset pipeline, if the file has changed (as you recently updated it), you will probably get the older stale file, if you cache your assets in any way (eg. CDN).
Will try to send a fix soon.
I am able to initialize the plug in, but utils.js isn't loading and so formating and validation of number is not happening. Am I missing something here?
Thank you.
How do you get the country code on jquery submit?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.