Project

mobit

0.0
No commit activity in last 3 years
No release in over 3 years
Write a longer description. Optional.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
 Project Readme

Mobit Gem Version

<div>
  <select name="phone_country_code">
    <option value="93" data-trunk-code="0">Afghanistan (+93)</option>
    <option value="355" data-trunk-code="0">Albania (+355)</option>
    <option value="213" data-trunk-code="0">Algeria (+213)</option>
      ...
    <option value="263" data-trunk-code="0">Zimbabwe (+263)</option>
  </select>
  <input type="phone" name="phone" required="required">
</div>

Installation

Add this line to your application's Gemfile:

gem 'mobit'

or

gem 'mobit', :git => 'git://github.com/rubybeast/mobit.git'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mobit

Usage

Simple Helper 'rails_phone_tag'

<%= rails_phone_tag :phone, '', required: true %>

Form For 'form.rails_phone_field'

<%= form_for @example do |f|%>
  <%= f.rails_phone_field :phone, required: true %>
  <%= f.submit %>
<% end %>

Simple_Form_For 'form.rails_phone'

<%= simple_form_for @example do |f|%>
  <%= f.input :phone, as: :country_phone, required: true %>
  <%= f.submit %>
<% end %>

Formtastic 'form.country_phone'

<%= semantic_form_for @example do |form| %>
  <%= form.country_phone :phone, required: true %>
  <%= form.submit %>
<% end %>

Contributing

  1. Fork it ( https://github.com/[my-github-username]/mobit/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request