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

handy_location_inputs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handy_location_inputs

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Handy Location Inputs

Handy Location Inputs is a rails gem/engine for adding powerful location inputs to your forms. It allows you to guarentee your Country, State, and City names will be uniform without the UX penalties of Select Boxes.

Requirements

Rails with turbolinks and bulma css. (Future versions will remove the dependency on Bulma.)

Installation

Add this line to your application's Gemfile:

gem 'handy_location_inputs'

And then execute:

$ bundle

Or install it yourself as:

$ gem install handy_location_inputs

Setup

First, add this line to your app/assets/javascripts/application.js manifest file.

// = require handy_location_inputs/input_controllers

Add Gon to your Gemfile gem "gon" and add <%= include_gon %> to the head tag of your application.

To use handy_location_inputs in a view, include HandyLocationInputs::Locatable to that view's controller.

If the associated model is new, or has no location data yet, call country_list_to_client to the controller action. This will pass the country list to the client.

If the model already has state and city data that you would like to pass to the client as well, call location_lists_to_client(your_model).

In The View

To trigger functionality in a form, include the class handy-location-inputs somewhere on the page.

Each input needs an id of country-input, state-input, or city-input respectively.

The dropdown for each input should look like this.

<div class="dropdown country-dropdown">
  <div class="dropdown-menu" role="menu">
    <div class="country-dropdown-content">
    </div>
  </div>
</div>

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 23 Jul 2019

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