Coder Social home page Coder Social logo

has_addresses's Introduction

has_addresses

has_addresses demonstrates a reference implementation for handling countries, regions, and addresses.

Resources

API

Bugs

Development

Testing

Source

  • git://github.com/pluginaweek/has_addresses.git

Mailing List

Description

Countries, regions, and addresses are all simple models whose data and functionality should be able to be standardized across multiple applications. has_addresses adds support for countries and regions based on the ISO 3166 and ISO 3166-2 standard. The data for these standards is obtained through the open-source Debian package, iso-codes.

Along with the simple Country and Region models, addresses can be defined and integrated based on the data in these models. Addresses are minimalistic in terms of the type of data required.

Usage

Note that this is a reference implementation and, most likely, should be modified for your own usage.

Installation

has_addresses requires additional database tables to work. You can generate a migration for these tables like so:

script/generate has_addresses

Then simply migrate your database:

rake db:migrate

Example

address = Address.new(
  :street_1 => '1600 Amphitheatre Parkway',
  :city => 'Mountain View',
  :region => 'US-CA',
  :postal_code => '94043'
)
address.single_line # => "1600 Amphitheatre Parkway, Mountain View, California  94043, United States"

Testing

Before you can run any tests, the following gem must be installed:

To run against a specific version of Rails:

rake test RAILS_FRAMEWORK_ROOT=/path/to/rails

Dependencies

has_addresses's People

Contributors

obrie avatar

Stargazers

Angus H. avatar Brian Dillard avatar Joshua Pinter avatar Chris Timperley avatar Alex avatar  avatar Rebecca Miller-Webster avatar Zvika Rap avatar  avatar Christian avatar German Monfort avatar Mike Gilbert avatar Diego R. Brogna avatar Etienne Samson avatar Aaron Hamid avatar Kevin DeGraaf avatar  avatar James Daniels avatar Pierre avatar Alexander Nеgоdа avatar Lance Pollard avatar Todd Eichel avatar Olivier Lauzon avatar Shane Zatezalo avatar  avatar Tyler Rick avatar Diego Scataglini avatar Florent Piteau avatar Paco Guzmán avatar Lee Nussbaum avatar Jan avatar Chris Johnson avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.