I’m trying to get this plugin to work: https://github.com/mettadore/geoinfo
It basically gets you all the cities and states in the United States.
However, it reads: “I haven’t added a rake task to populate the database yet. But the YAML files are in vendor/plugins/geoinfo/lib/db/*.yml”
Alright, no problem, I’ll do it manually then. However, I look in the file, and I find stuff that looks like this:
- !ruby/object:GeoinfoState
attributes:
name: STATE
abbr: ABBR
country: COUNTRY
type: TYPE
id: “ID”
- !ruby/object:GeoinfoState
attributes:
name: ALASKA
abbr: AK
country: UNITED STATES OF AMERICA
type: STATE
id: “1”
- !ruby/object:GeoinfoState
attributes:
name: ALABAMA
abbr: AL
country: UNITED STATES OF AMERICA
type: STATE
id: “2”
- !ruby/object:GeoinfoState
attributes:
name: ARKANSAS
abbr: AR
country: UNITED STATES OF AMERICA
type: STATE
id: “3”
and so on
The file name is states.yml.
Now, my question is what exactly is this file? How do I use it? The syntax doesn’t exactly look like its a fixture…
I’m confused on how I can populate my db tables with that file. Does anyone know how? What is that file used for? how?
Thank you.
-David