*CSET 160.3*: Hello, Rails! How to use these slides: * <kbd>P</kbd> toggle presenter notes * <kbd>?</kbd> help menu * <kbd>→</kbd> next slide Also, [here's the source](https://github.com/chadoh/cset160) --- CSET 160.3 # Hello, *Rails*! --- attendance # What's the last restaurant you ate at? --- concept # CRUD -- *C*reate *R*ead *U*pdate *D*estroy --- class: small outline 1. *review* of last class -- 2. *improving* our Cuba app: adding **edit** functionality -- 3. *improving* our Cuba app *pt II*: improving data handling, meeting `activerecord` -- 4. intro to *Rails* -- 5. *Lab* --- *review* # git tells a story; GitHub is your résumé ??? A lot of you did not have descriptive commit messages, and sometimes didn't have commit messages at all. And okay, GitHub isn't really so much your résumé as it is your _portfolio_. But that matters! If you use git and GitHub well, it is a great way to show off your skills. Working in an industry where people care about the work you do, not the credentials you have, is empowering. But it also means _there's no faking it._ You can't stumble your way through and get a grade and not learn anything and expect to get a job. You have to actually do the work! Regarding commits: Keep 'em small. Keep 'em focused. Keep the messages good (https://chris.beams.io/posts/git-commit/). This is for your own clarity and your future self's benefit more than it's for anyone else, probably. --- *review* # simple Ruby apps with Cuba --- *review* # why am I here? ??? I'm here to unblock you. To help you learn. I'm not going to judge you if you're late or get angry if you're stuck. I'm going to help you. That's the whole reason programs like this exist, rather than everyone learning for free online. I don't like grades. I wish I didn't have to grade you. The only thing I care about is you actually learning the material. When you take a Remote Work Day as an excuse to not do anything, it makes me feel like you're not in this with me. That you don't take it seriously, and you don't actually care to learn. Ask me questions. Use me as a resource. --- *improving* • live coding # adding edit functionality --- class: center, middle *break* --- class: small *improving pt II* • live coding # move data-handling to a Model and use `activerecord` ??? Reference: [Go approximately commit-by-commit through this change](https://github.com/chadoh/cset160-2-bare-bones-ruby/compare/activerecord) --- class: center, middle *break* --- *Rails* • introducing # *Rails* --- *Rails* • prelude # convention over configuration --- *Rails* • try it * `gem install rails` * `rails new rails-demo` --- *Rails* • tour # wow, that's a lot of stuff --- *Rails* • tour we already know about some of this -- * `Gemfile` & `Gemfile.lock` -- * `config.ru` -- * `config/database.yml` -- * `app/views` & `app/models` --- *Rails* • Introducing *MVC* <br> (*M*odel *V*iew *C*ontroller) # The Waiter, The Kitchen, & The Plate --- background-image: url(img/waitress.jpg) background-size: cover # *controller* ??? Photo by [Steven Cleghorn][1] on [Unsplash] [1]: https://unsplash.com/photos/psomVjxL29Y [Unsplash]: https://unsplash.com/search/photos/waitress --- background-image: url(img/kitchen.jpg) background-size: cover class: right # *model* ??? Photo by [Ash Edmonds][2] on [Unsplash] [2]: https://unsplash.com/photos/FiPot-1rsZw --- background-image: url(img/plate.jpg) background-size: cover class: right, bottom # *view* ??? Photo by [Brooke Lark][3] on [Unsplash] [3]: https://unsplash.com/photos/jUPOXXRNdcA --- *Lab* # Teach Yo'self Book → [Hartl Tutorial](https://www.railstutorial.org/) <br> Interactive → [Rails for Zombies](http://railsforzombies.org/)