Question
Instruction You will create an application that consumes the World Population API and allows individuals to view a list of countries. The Show method of
Instruction
You will create an application that consumes the World Population API and allows individuals to view a list of countries. The Show method of each Country should display the age distribution of the population of the selected country for the current year.
I have created a new Rails application called worldpopulation. This application will have one (and only one!) model: Country. Scaffold it according to the following diagram:
Question
In the index method for Country, check to see if there are any Country objects currently stored in the database. IF NOT, query the API and create a new Country object for each country returned from the service. (HINT: write a CLASS METHOD in the Country model that contains the code to execute the query and update the database.)
Link to World Population API http://api.population.io/#!/countries/listCountries
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started