Lesson 1: Forms & Embedded Ruby
Core Learning Goals/Questions
- Learn to use the templating tools that Rails builds in (ERB)
- Lab: Demo with
rails-decal/weather Whales project
- Use ERB to place weather info from a
WeatherService blackbox module into a template
- Use query parameters to pass in a city name dynamically
- Create form to add new cities
Lesson 2: Deeper Dive into Models, Controllers and Routing
Core Learning Goals/Questions
- Build on the Weather example to store cities that have been created in a memory store
- Create a class called
City that stores the information
- Store all new
City instances in a $cities global
- Render all
$cities in a template
- Build on the memory store example to use Active Model instead
- Create
City in app/models and add columns
- Create migration to update DB
- Run
rails db:migrate in Bash console
- MVC. Let's talk about the conceptual stuff from week 1 down to a tech. level using the vocab we've learned. Aka, router to databases.
Notes
- Let's test out the ruby we just learned. Make clear logic-side of controllers
- Quick foray into routing, briefly discuss what it's
Part 2
Now that you've gone through all the things we've learned so far and tried out each of them yourself, pick 2-3 of the challenges below and try them out! There will be less guidance for each of them (except for any new information), so work with your peers and look through the lecture guides in case you forget something.
Challenge 1