-
You should have gotten here by clicking the assignment from within Canvas.
-
Setup a Cloud9 workspace as usual with one exception; choose "Private" rather than "Public". We're going to use our one and only Private workspace in Cloud9's free tier today.
If you already created a Private workspace in the past by accident, it won't let you create another one. Click on each workspace's name in your Cloud9 Dashboard until you find the Private one (it will have a lock beside its name). Scroll to the bottom, and make the old one Public, then try creating
catalogagain as Private. -
In a Terminal, run
bin/setup. -
Run Project and visit your app in Chrome.
-
You may be prompted to run a different
bin/whitelist X.X.X.Xcommand each time your IP address/location changes; copy-paste it into a terminal prompt if so. -
Enable Auto-save and refresh Cloud9.
-
Check your progress/submit your work with
rails grade:allas usual.
If at any point
rspecfails with the message "Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=test" then run
rails db:migrate RAILS_ENV=test
You may refer to your notes, homeworks, the Ruby docs, GitHub, the forum, or anything else except for a live person (e.g., one of your classmates or a developer friend).
Close/put away/don't use any messaging client, including but not limited to email, Slack, SMS, smart watches, walkie talkies, or vocal chords.
- Use
/gitto commit and branch often; in particular, after you complete a problem and before you start the next. - Let Ruby's error messages guide you. They are trying to be helpful; they just have poor social skills. Try to make sense of their overly formal wording. The error pages also display helpful information like what controller and action were being routed to, and what was in the
paramshash. - Refer to your past work. This isn't a memorization competition.
- If you encounter an error that you think is environment or git related, ask a Private question on Piazza; we’ll tell you if it’s something you should be figuring out on your own or not. If it's HTML, Ruby, RCAV, params, or CRUD-related, we can't help; but we can tell you the difference.
- You don’t have to worry about CSS styling at all; just get the app to do the right thing.
- Use the server log to verify that URLs are being routed to the actions you think they are, and to see what is coming in to the
paramshash. - In your browser, don’t get confused between the target app and your development app. Make sure you are refreshing your own app to test your work.
- Don't get stuck on any one thing for too long; move on and score easy points on the next problem.
This application has 3 database tables:
- coffee beans (columns: blend name, variety, origin, notes)
- foods (columns: ingredient, spice, measurement, store address)
- lists (columns: title, description)
Each resource needs 7 "golden" actions to allow users to interact with it:
- new_form
- create_row
- index
- show
- edit_form
- update_row
- destroy
For the first two, the Golden Seven exist but are buggy. Your primary job is to debug them all until you can create, read, update, and delete each of coffee beans, and foods without running into any issues. Your secondary job is to do a bit of geocoding on the show page of Foods.
Then you have to build the Golden Seven for Lists from scratch.
Make yours work like it. Your local app is using a light theme, and the reference app is using a dark theme so that you don't get confused between tabs as you try to check your work.
Click through the app and debug. Try adding a new coffee bean, updating a coffee bean, looking at the details of a coffee bean, and deleting a coffee bean.
Sometimes you will get an error message; sometimes there won't be an error message, but the action just won't do its job. Use the server log to help figure out what's going on.
All in all, you need to:
- Fix the Golden Seven for Coffee Beans.
- Fix the Golden Seven for Foods.
- Build the Golden Seven for Lists from scratch. I've already generated the model for you, so you just have to do the RCAVs.
- Some geocoding: On the show page for each food, display the correct latitude and longitude of the food based on the value in its
store_addresscolumn. Currently, every food shows the same latitude and longitude, which is wrong. Use Google's Geocoding API.
In the unlikely case that you reach Google's Maps API free usage limit, use the following API URL stub:**
It contains my API token in one of the query string parameters, so should lift the limit.
OPTIONAL: Last, work on centering the embedded Google Map on the show page for each food on its real store address. Currently, every map is centered on the same location (the White House), which is wrong. Replace the static bits of the JavaScript that you want to be dynamic with embedded Ruby, the same as you do with HTML.