0.0
No commit activity in last 3 years
No release in over 3 years
Easy way to create Rails forms with greek city and states, diplayed in Greek.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
 Project Readme

Build Status

greek-cities ruby gem

Includes all the states (nomous) of Greece and their biggest cities, displayed in greek. Easy way to populate Rails forms with greek cities.

Install the gem

# Rails
gem 'greek-cities'

# Ruby
gem install 'greek-cities'
require 'gc'

List of all states

GC.states
# => [["Αιτωλοακαρνανίας", "ait"], ["Αργολίδας", "arg"], ["Αρκαδίας", "ark"]...

Returns all the states with their corresponding codes.

List of cities

GC.cities("arg")
# => [["Άργος - Μυκήνες", "argos-mikines-ARG"], ["Επίδαυρος", "epidavros-ARG"], ["Κρανίδι", "kranidi-ARG"], ["Ναύπλιο", "nafplio-ARG"]]

Fetch a state name in Greek

GC.get_state_name('ait')
# => "Αιτωλοακαρνανίας"

Fetch a city name in Greek

GC.get_city_name('att', 'holargos-ATT')
# => "Χολαργός"

Enter a state code as an argument. It's not case sensitive, you could enter "ARG".

Rails examples

<%= options_for_select GC.states %>

# output:

<option value="ait">Αιτωλοακαρνανίας</option>
<option value="arg">Αργολίδας</option>
...
<%= options_for_select GC.cities('arg')%>

# output:

<option value="argos-mikines-ARG">Άργος - Μυκήνες</option>
<option value="epidavros-ARG">Επίδαυρος</option>
...

greek-cities License

greek-cities is an open source project by Alex Avlonitis with an MIT license.