GeoSelect
GeoSelect helps to auto-populate countries, states, regions and cities options to your select_tag form helper. It is based on http://geonames.org services.
Installation
Add this line to your application's Gemfile:
gem 'geo_select'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install geo_select
Must Add to application.js:
//= require geo_select
Usage
<%= form_tag("/site/index") do %>
<%= label_tag 'name' %>
<%= select_tag(:country, nil, { class: 'geo-countries'}) %>
<%= label_tag 'name' %>
<%= select_tag(:state, nil, { class: 'geo-states' }) %>
<%= label_tag 'name' %>
<%= select_tag(:region, nil, { class: 'geo-regions' }) %>
<%= label_tag 'name' %>
<%= select_tag(:city, nil, { class: 'geo-cities' }) %>
<% end %>
Contributing
- Fork it ( https://github.com/mrdivyansh/geo_select/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request