thecodecrate / city-state

Simple ruby gem to create form lists with cities and states
MIT License
306 stars 135 forks source link

Ability to query cities by country name in addition to country code #33

Open sarmad90 opened 6 years ago

sarmad90 commented 6 years ago

Hey! I'm using this gem, going well so far. I needed to query cities with country name as compared to only being able to query cities with country code, so I've written a small method to do that. Take a look if you find it useful and think it should be merged. Thanks.

TahaMaqbool commented 5 years ago

@sarmad90 I did this to solve this problem CS.states(:us).keys.flat_map { |state| CS.cities(state, :us) }