Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

countries_regions_and_cities_by_peterconsuegra

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

countries_regions_and_cities_by_peterconsuegra

  • 0.2.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Countries Regions And Cities By Peter Consuegra

An agile way to implement Countries, Regions and Cities in your project, without the need to create additional tables

Installation

Add this line to your application's Gemfile:

gem 'countries_regions_and_cities_by_peterconsuegra'

And then execute:

$ bundle install

Run the rake command to generate the necessary files:

$ bundle exec rake 'install_countries_regions_and_cities_to_model[your_model_name]'

Rails

Add this code to the _form.html.erb partial of your_model_name form


<div class="field" id="country_field">
<%= render partial: 'shared/peterconsuegra_country_select', locals: {model: form.object.class.name.downcase, label: "Country", selected: form.object.country} %>
</div>

<div class="field" id="region_field">
<%= render partial: 'shared/peterconsuegra_region_select', locals: {model: form.object.class.name.downcase, label: "Region / State", selected_country: form.object.country, selected: form.object.region} %>
</div>

<div class="field" id="city_field">
<%= render partial: 'shared/peterconsuegra_city_select', locals: {model: form.object.class.name.downcase, label: "City", selected_region: form.object.region, selected_country: form.object.country, selected: form.object.city} %>
</div>


Video Tutorial

Watch this video to see how it works

IMAGE ALT TEXT HERE

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/peterconsuegra/countries_regions_and_cities. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Code of Conduct

Everyone interacting in the CountriesRegionsAndCitiesByPeterconsuegra project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 11 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc