Need API Keys in ENV
DARK_SKY_KEY=''
GEOCODING_API_KEY=''
Here is some more practice on building a web interface to our database using ActiveRecord.
We’re going to refactor MSM Queries with a powerful technique for taking advantage of one-to-many and many-to-many associations between tables.
First, load this project and read through the code, starting as usual with config/routes.rb. The starter code for this project is the solution to the first MSM Queries project. How does my solution compare to yours? Where does it differ?
Then, following along with this Video: Refactoring MSM Queries 1. In it, I demonstrate how to refactor the project. Just watch while I do the first part, and if you have any questions pause the video and ask us.
Then you’ll have a chance to do more yourself. Open up and read through this Chapter for a detailed written explanation: Refactoring MSM Queries with Methods.
Practice building a web CRUD interface by debugging.
CRUD resources are the foundational building blocks of web applications — a database table, along with routes/actions/views/forms/links that allow users to see and manipulate entries in that table. Being a web developer means identifying, building, and assembling these resources in useful ways all day, every day.
Now that you’ve seen a few examples of how to wire a complete CRUD resource (in Photogram GUI and Very Best Debug), try building some on your own, from scratch.
Imagine that we’re building a simple, anonymous neighborhood bulletin board:
(If you want to, feel free to come up with your own, different data model / user stories. But keep it simple — 2-4 tables and a simple CRUD UI, without sign-in/sign-out.)
On paper or a whiteboard, draw a rough wireframe of the app you plan to build. Things to think about:
If you’d like to get the Google Translate portion working (optional), then you’ll have to create the following environment variables (don’t forget to restart your workspace after doing so):
TWILIO_ACCOUNT_SID:
TWILIO_AUTH_TOKEN:
TWILIO_SENDING_PHONE_NUMBER:
MAILGUN_API_KEY:
TRANSLATE_PROJECT:
TRANSLATE_CREDENTIALS:
In the video, you’ll see me using a hash called session instead of a hash called cookies to store and fetch the signed in user’s ID. We use session exactly the same way as cookies, but it’s more secure. read more
This is the practice exam. It is intended to help you identify areas to review before the real one.
Attempt to complete it under circumstances similar to the real exam: you can (and should) use your notes, previous work, the videos, Chapters, Google, and other resources; but not a live human being.
If you’re well and truly stuck, then get help (from an instructor, ideally). Once you’ve completed this project, filled in gaps in your notes, and feel ready for the real exam, ask an instructor to unlock it for you.
This is the exam.